Download & Extend

Error Editing Profile Type

Project:Homebox
Version:7.x-2.0-beta3
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Issue tags:profile

Issue Summary

After editing a profile type, I received the following error:

Undefined property: ProfileType::$delta in homebox_forms() (line 203 of /var/aegir/platforms/drupal-7.0-essentials/sites/all/modules/contrib/homebox/homebox.module).

Running D7 on Ubuntu 10.04 (Lucid).

Thanks

Comments

#1

Can't reproduce. Anyone else?

#2

I have seen this error on a site I am building. Basically any use of the entity API will potentially cause this error.

In the implementation of hook_forms on lines 195-205 in homebox.module, there is a simple conditional within a switch:

case isset($args[1]) && is_object($args[1]) ? 'homebox_block_edit_' . $args[1]->module . '_' . $args[1]->delta . '_form' : NULL:

So essentially, any form that passes an object as the second argument will return TRUE for this statement. Almost all Entity API framework forms pass 3 variables: $entity_type, $entity, $op, so they will return true for this, but they don't have a delta.

I am not sure what is going on here, but if you are trying to catch homebox block form implementations, might have to add a

strpos('homebox', $form_id) !== FALSE

conditional to make sure we are not getting any old form generated with drupal.

#3

OK, I get it now, you are checking to find any block forms on the homebox page that may have submit buttons, so as to add ajax action to them.

I am using this line as a patch:

case isset($args[1]) && is_object($args[1]) && isset($args[1]->module) && isset($args[1]->delta) ? 'homebox_block_edit_' . $args[1]->module . '_' . $args[1]->delta . '_form' : NULL:

very long and ugly, but seems to work.

nobody click here