Submitting a node form (on node save or update) from within an overlay throws this notice:

Notice: Undefined index: rebuild in drupal_build_form() (line 239 of /opt/www/deploy/drupal-7.x-dev/includes/form.inc).

Submitting a node form to Delete a node from within an overlay throws the following two errors (logged separately):

Notice: Undefined index: system_paths in drupal_cache_system_paths() (line 164 of /opt/www/deploy/drupal-7.x-dev/includes/path.inc).
Warning: current(): Passed variable is not an array or object in drupal_cache_system_paths() (line 169 of /opt/www/deploy/drupal-7.x-dev/includes/path.inc).

Due to the nature of the overlay, they can be spotted only briefly in the form render itself after submission but are logged to dblog.

Adding, updating or deleting an article by manually visiting the node form (i.e /node/add/article or /node/2/edit) without the overlay doesn't show these errors, and likewise if Overlay is disabled entirely.

CommentFileSizeAuthor
#6 nodeformrebuild.patch671 bytescasey

Comments

David_Rothstein’s picture

Title: Submission of node form throws PHP undefined index errors » Submission of node form throws PHP undefined index errors and sometimes does not create the node
Priority: Normal » Critical

I'm also finding that if you try to submit the node by hitting enter in the title field, not only does it throw the error described above, but it also fails to create the node (even though it closes the overlay and acts like the node was created).

Perhaps a separate bug, but for now seems related enough to file it here... and this is critical.

Anonymous’s picture

I can confirm the behaviour in #1 as well, but also that hitting enter on a node form in the title field without Overlay also fails, and simply re-renders the node form with no form error, so it seems like a general problem outside of overlay itself.

alex ua’s picture

I also encountered this error when I added my first page on a new D7 install

bobmarchman’s picture

Also confirming the first error listed.

I, too, encountered this while saving during node add and node edit for both of Drupal 7's default content types (page and article) when using the overlay. On both insert and update, nodes would save and display each time seemingly without error. Without the overlay, the node saved and updated without error. Confirmed with watchdog logs.

Looks like there's some issues to iron out with form caching and node form submission. The undefined index error on node save/edit has something to do with $form['rebuild'] being unset in node_form_submit() and then drupal_build_form() being called after the fact, when $form['rebuild'] is no longer defined. I have to poke around some more to get the exact order of operations to see when this happens, but the fix may lie in either wrapping $form['rebuild'] with an isset() on line 239 of form.inc or by putting a conditional in some where to ensure $form['rebuild'] has SOME value whenever drupal_build_form() is called during the node save/edit process.

Of course, I humbly acknowledge I could be way off base as I'm not nearly as familiar with D7's API as I am with D6. Just throwing out ideas.

As for the node delete errors, I was unable to reproduce those, overlay or no overlay. I'm using the 7.x-dev version released on Dec 18th, so that issue potentially may have been addressed.

sun.core’s picture

Priority: Critical » Normal

$form['rebuild'] simply should not be unset. It is expected to exist at any time, so we just need to set it to FALSE.

casey’s picture

Component: overlay.module » node.module
Status: Active » Needs review
StatusFileSize
new671 bytes

So this belongs to the node.module component.

casey’s picture

Still applies.

casey’s picture

Status: Needs review » Fixed

It already has been fixed.

Status: Fixed » Closed (fixed)

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