Hi,

I ran into a small problem, when trying to develop a custom views cache plugin.

Hooks (hook_views_api, hook_views_plugins) were correctly setup, and the cache plugin was visible in the ui, but could not be selected or configured ("settings").

Turns out i forgot to add the cache plugin in the files[] section of the .info file. Whilst this is not really a views issue, it would be great if the _views_create_handler()-function could provide a little debug/warning.

As discussed with @dereine on IRC, please find a small patch attached.

CommentFileSizeAuthor
#2 handler-vpr-2.patch1.64 KBfrega
handler-vpr.patch1.07 KBfrega

Comments

dawehner’s picture

What about a short suggesting to look up in .info files?
This was your major issue, so ...

frega’s picture

StatusFileSize
new1.64 KB

Updated patch attached. Includes a vpr-message for empty($definition['handler']).

oadaeh’s picture

This patch does not seem to work for me. If I replace vpr w/debug, I get messages, but not w/vpr. I'm guessing these messages are supposed to be showing up in the devel debug message area, which I set to be the header. If I'm wrong, please enlighten me.

oadaeh’s picture

There seems to have been a problem with the debug output (#1387934: Remove region support for vpr), which may be why I wasn't seeing the messages.

With that fixed, I now see the messages.

Is it necessary to repeat the class name twice? It seems to me something like

      '_views_create_handler - loading override handler @type failed: the @override_handler class could not be loaded. ' .
      'Verify the class file has been declared in the corresponding .info file, using the files[] property.',

and

      '_views_create_handler - loading handler @type failed: the @handler class could not be loaded. ' .
      'Verify the class file has been declared in the corresponding .info file, using the files[] property.',

would be a little easier to read and understand.
A link to the documentation might help (http://drupal.org/node/542202#files).
Also, as long as you're at it, you might add a statement to clear caches after adding the files property.

dawehner’s picture

Title: Provide (developer) feedback when handler cannot be instantiated / loaded (minor DX improvement) » Provide (developer) feedback when handler cannot be instantiated / loaded (major DX improvement)
Status: Active » Fixed

Thanks for the work here, committed with the changes in #4

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.