Add a interface for the plugins and also some exception throwing when plugins are not loaded correctly. This should fix all of our issues where loading a bean calls a fatal error.

Comments

indytechcook’s picture

Status: Active » Needs review
StatusFileSize
new5.18 KB

Attached patch

mrfelton’s picture

Status: Needs review » Needs work

Nice. However its giving me a WSOD:

[22-Jun-2011 21:04:00] PHP Fatal error: Declaration of bean_default::view() must be compatible with that of bean_type_plugin_interface::view() in /Users/tom/workspace/alumni/profiles/alumni/modules/contrib/bean/plugins/base.inc on line 80

indytechcook’s picture

Status: Needs work » Needs review
StatusFileSize
new5.08 KB

Try this one

mrfelton’s picture

Status: Needs review » Needs work

Different, but similar problem this time:

[22-Jun-2011 21:18:22] PHP Fatal error: Declaration of bean_default::form() must be compatible with that of bean_type_plugin_interface::form() in /Users/tom/workspace/alumni/profiles/alumni/modules/contrib/bean/plugins/base.inc on line 80

indytechcook’s picture

Status: Needs work » Needs review
StatusFileSize
new5.07 KB

The problem is with the new type casting. It's a good idea but it's a major API change that isn't necessary.

Here is an updated patch.

mrfelton’s picture

Status: Needs review » Needs work

Getting there. The previous errors have gone, and beans display ok. But, if I try to access the bean type admin page (/admin/structure/block/types) I get the following:

[22-Jun-2011 21:33:33] PHP Fatal error: Interface 'bean_type_plugin_interface' not found in /Users/tom/workspace/alumni/profiles/alumni/modules/contrib/bean/plugins/base.inc on line 8

Same issue for the bean add page at block/add

indytechcook’s picture

yeah, that's because the code registry needs to be updated. I'll write an update hook.

indytechcook’s picture

Status: Needs work » Needs review
StatusFileSize
new5.41 KB

Ok, here is the patch with an update statement to clear the registry.

mrfelton’s picture

Good, that seems to do the trick. I'd reword te comment for the update hook though from "Implements hook_update_N" to something that describes what is happening in the update, since that string is displayed to users in update.php.

indytechcook’s picture

Status: Needs review » Fixed

Good Call. I committed.

Status: Fixed » Closed (fixed)

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