Hi,
I just created a custom module with a custom style plugin. (and cleared caches..)
The style plugin is presented as an option in the views configuration form.
However, if I choose that option and submit, the option does not change at all.
I can successfully switch between "unformatted" and "slideshow" etc, but I cannot choose my own plugin.

So.. I suppose I did something wrong, and I would not be surprised if I find a nasty bug in my custom module.
Unfortunately, there is very little error reporting. Even the Drupal logs won't tell me :(

I can start digging myself, but it would be nice if I knew where to start (for putting my dpm() and friends)
And ultimately, we could turn this into a feature request, and implement some decent error reporting.

Comments

merlinofchaos’s picture

Status: Active » Fixed

This most likely means you did not add the file containing the class to your .info file, so the class cannot be found because it is not in the registry.

donquixote’s picture

aaah, great, thanks!!
I almost always use xautoload for my modules, so I almost forgot this info file thing.

Should we not add a warning message "views plugin class not found", instead of just silently failing?

Status: Fixed » Closed (fixed)

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

kobnim’s picture

Version: 7.x-3.x-dev » 7.x-3.5
Category: support » feature
Status: Closed (fixed) » Active

I just wanted to second donquixote's suggestion, as someone who has tripped over this problem several times:

Should we not add a warning message "views plugin class not found", instead of just silently failing?

dawehner’s picture

Isn't there a message displayed if you enable the views debug messages in the settings, already?

donquixote’s picture

Can't say atm..
but I would not make this dependent on a setting.
Just throw an exception with the message, and let other modules (and settings) determine how this exception is going to be displayed.

I imagine the debug messages are for things that are not directly considered as a bug/error.

kobnim’s picture

@dawehner,
Yes, you are correct, there is a message. Somehow I had missed it.

dawehner’s picture

@donquixote
This might be possible in D8, but we simply can't change this behavior in 7.x-3.x, because people might have "broken" views which still works due to that somehow.