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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

brianV’s picture

Can't reproduce. Anyone else?

wesnick’s picture

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.

wesnick’s picture

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.

rv0’s picture

Status: Active » Reviewed & tested by the community
FileSize
727 bytes

Patch by JaakkoL in #1088242: Undefined index: module in homebox_build() (line 360 of homebox.module) works for this

I post it here for clarity

mzwyssig’s picture

#4 works for me as well. Will this get committed ?

drumm’s picture

Status: Reviewed & tested by the community » Fixed

Committed.

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