Fix for subscriptions_content.module - notice: Undefined index: #value in C:\Programs\WAMP\www\TRUNK\sites\all\modules\subscriptions\subscriptions_content.module on line 550.

CommentFileSizeAuthor
#2 289084.JPG61.07 KBnburles
subscriptions_content.module.patch839 bytesnburles

Comments

salvis’s picture

Status: Needs review » Postponed (maintainer needs more info)

On certain pages

Name one...

nburles’s picture

StatusFileSize
new61.07 KB

For instance: Upon creation of this page - http://localhost/transit/node/180 (which you cannot of course access, so I have attached a screenshot):-

salvis’s picture

The screenshot shows creation of an Organic Group, right? Are groups nodes? subscriptions_content.module is intended for handling nodes (and comments) only. If non-nodes are passed through there, there may be other issues, or it may be an issue with subscriptions_og.

Do you also get this when creating other types of content?

nburles’s picture

Organic groups is implemented as a specific type of node.

I do not get the issue when creating other types of node, I'm not sure why I do when creating this type - but the problem is that for some reason on this type of node, although the $form['type'] is set, the $form['type']['#value'] is not. This (as far as I can tell) should never actually happen, and would be part of the main drupal code, but I have found that it does in this instance, and so thought it would be safer to just check if $form['type']['#value'] is set before attempting to compare it to $form_id.

salvis’s picture

Title: On certain pages the subscriptions_content.module creates an error notice on line 550 » On OG group creation pages the subscriptions_content.module creates an error notice on line 550

I see — interesting!

if (isset($form['type']) && $form['type']['#value'] .'_node_form' == $form_id)

was the way to check for node creation forms in hook_form_alter under D5 (see menu.module, path.module, and taxonomy.module).

This has apparently changed to

if (isset($form['#node']) && $form['#node']->type .'_node_form' == $form_id) (menu.module)
if (isset($form['type']) && isset($form['#node']) && $form['type']['#value'] .'_node_form' == $form_id) (path.module and taxonomy.module)

Neither of these do a isset($form['type']['#value']) check, as you suggest with your patch.

There's some mention of this on http://drupal.org/node/114774#node-preview, but I'm not sure how to interpret it in our context here...

@chx: can you provide some enlightenment?

salvis’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Hmm, we got stuck here.

Please reopen if we should pursue this further...