Defining custom views

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by beautifulmind on November 29, 2008 at 9:52am

Hello Views developers!

I read the mission statement of the group and I got some relief:

This group exists as a place for people interested in the group to talk about Views development; all development talk is encouraged here, from people who want to work on Views core to people who are interested in Views' API for their own modules.

I am developing views for my custom modules, but having problem with handlers. I can't figure out how to use those handlers.
I defined handlers but when I select the filter I added to the views it shows and error:

Error: handler for my_table > my_field doesn't exist!

Any help?

Regards.

Categories:

Comments

clever man

Posted by pragna on November 29, 2008 at 11:22am

you are clever, so you can do it

hook_views_handlers

Posted by pasqualle on November 29, 2008 at 4:01pm

you need the hook_views_handlers() hook
The full documentation for this hook is in the advanced help.

*_*

Posted by beautifulmind on December 1, 2008 at 4:17am

Yes I did write the hook_views_handlers(), but any how, it doesn't help.
Also, I've done as mentioned with advanced help section.

Thanks for reply.

:)
Beautifulmind

*_*

Posted by beautifulmind on December 1, 2008 at 5:17am

Now am able to add handler I defined for my module but now it throws following error message:

An error occurred at http://mydomain/admin/build/views/ajax/add-item/my_view/page_1/filter.

The error is a javascript alert.

I think, still there is something that am missing in my module. If you have any links for how to defined handlers, it would be help me a lot.

Regards.

:)
Beautifulmind

how to see the original error

Posted by pasqualle on December 1, 2008 at 10:35am

disable javascript in your browser to see the original error

*_*

Posted by beautifulmind on December 2, 2008 at 10:32am

That solved my problem!!
Thanks a lot. But when previewing the view, I see an error in which the filter I added does not replaced with value.
Instead it shows Array() in the query.

I use the following code in my plugin.

$this->query->add_where($this->options['group'], "$this->table_alias.$this->real_field "
. (empty($this->value) ? '!=' : '=') . " CURRENT_USER");

Its the same as in views_handler_filter_user_current.inc in views.

:)
Beautifulmind

more info needed

Posted by pasqualle on December 2, 2008 at 1:40pm

If it is the same then the problem should be somewhere else. Can you post the full code of your handler?

Views Developers

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

AltStyle によって変換されたページ (->オリジナル) /