Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I see the following error notice on a Pressflow site:
Notice: Undefined index: type in node_gallery_hierarchy_form_alter() (line 202 of /opt/drupal/6/modules/node_gallery_hierarchy/node_gallery_hierarchy.module).
though regular Drupal 6 site on the same server doesn't output such notice. The discussion on http://groups.drupal.org/node/170339 suggests
Pressflow uses the more strict PHP E Notice - by default... great for revealing issues!
Changing line 202 from
if (in_array($form['type']['#value'], (array)node_gallery_get_types('gallery'))) {
to
if (in_array(isset($form['type']['#value']), (array)node_gallery_get_types('gallery'))) {
takes care of the issue.
However, I wanted to be sure if that was the correct approach to address the issue and so reporting this here.
http://drupal.org/node/1063684, http://drupal.org/node/984006#comment-3772862 suggest suppressing the notices, but I really like addressing the error notices instead of suppressing even though they were just notices.
Comments
Comment #1
scroogie CreditAttribution: scroogie commentedIt should probably be
Otherwise the return code of isset() (true/false) is searched in the array instead of the form type value.
Comment #2
yngens CreditAttribution: yngens commentedUnfortunately, your code produces "HTTP Error 500 "
continues to give the same error notice.
Comment #3
scroogie CreditAttribution: scroogie commentedHi yngens,
I didn't see that its already the "form" element thats missing. Although I guess that shouldn't happen, you'd need to check both:
Comment #4
scroogie CreditAttribution: scroogie commentedchanged tracker. Note that the 6.3.x branch of NG and NGH is not really maintained anymore.
Comment #5
yngens CreditAttribution: yngens commentedtoo much hassle to make all the modules work with pressflow, so decided to switch to regular durpal 6. thanks anyway!
Comment #5.0
yngens CreditAttribution: yngens commentedadded