Closed (fixed)
Project:
Drupal core
Version:
6.x-dev
Component:
node system
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Jul 2007 at 14:08 UTC
Updated:
23 Aug 2007 at 11:18 UTC
Jump to comment: Most recent file
Comments
Comment #1
pwolanin commentedI can confirm this (PHP 4.4.7) - it also happens when JS is disabled.
Comment #2
pwolanin commentedIs it possible that this issue is a manifestation of this bug? http://drupal.org/node/146667
Comment #3
yasheshb commentedi tested this on php 5.2.3 and did the following steps to reproduce and check the problem.
1 - created a page "Page 2"
2 - save node
3 - edit node - removed "Page 2" from body and added "New Page 2".
4 - clicked on Preview button.
on clicking the preview button, i got a whole bunch of php notices
----------------------------------------------------------------------------------------------------------------------------------------------------------------
* notice: Trying to get property of non-object in /work/projects/testsites/drupal/6.x/testsite8/www/modules/taxonomy/taxonomy.module on line 48.
* notice: Trying to get property of non-object in /work/projects/testsites/drupal/6.x/testsite8/www/modules/taxonomy/taxonomy.module on line 49.
* notice: Trying to get property of non-object in /work/projects/testsites/drupal/6.x/testsite8/www/modules/taxonomy/taxonomy.module on line 74.
* notice: Undefined index: in /work/projects/testsites/drupal/6.x/testsite8/www/modules/taxonomy/taxonomy.module on line 1161.
* notice: Trying to get property of non-object in /work/projects/testsites/drupal/6.x/testsite8/www/modules/taxonomy/taxonomy.module on line 75.
* notice: Trying to get property of non-object in /work/projects/testsites/drupal/6.x/testsite8/www/modules/taxonomy/taxonomy.module on line 75.
* notice: Trying to get property of non-object in /work/projects/testsites/drupal/6.x/testsite8/www/modules/taxonomy/taxonomy.module on line 78.
* notice: Trying to get property of non-object in /work/projects/testsites/drupal/6.x/testsite8/www/modules/taxonomy/taxonomy.module on line 51.
* notice: Trying to get property of non-object in /work/projects/testsites/drupal/6.x/testsite8/www/modules/forum/forum.module on line 434.
* notice: Trying to get property of non-object in /work/projects/testsites/drupal/6.x/testsite8/www/modules/taxonomy/taxonomy.module on line 48.
* notice: Trying to get property of non-object in /work/projects/testsites/drupal/6.x/testsite8/www/modules/taxonomy/taxonomy.module on line 49.
* notice: Trying to get property of non-object in /work/projects/testsites/drupal/6.x/testsite8/www/modules/taxonomy/taxonomy.module on line 74.
* notice: Undefined index: in /work/projects/testsites/drupal/6.x/testsite8/www/modules/taxonomy/taxonomy.module on line 1161.
* notice: Trying to get property of non-object in /work/projects/testsites/drupal/6.x/testsite8/www/modules/taxonomy/taxonomy.module on line 75.
* notice: Trying to get property of non-object in /work/projects/testsites/drupal/6.x/testsite8/www/modules/taxonomy/taxonomy.module on line 75.
* notice: Trying to get property of non-object in /work/projects/testsites/drupal/6.x/testsite8/www/modules/taxonomy/taxonomy.module on line 78.
* notice: Trying to get property of non-object in /work/projects/testsites/drupal/6.x/testsite8/www/modules/taxonomy/taxonomy.module on line 51.
* notice: Trying to get property of non-object in /work/projects/testsites/drupal/6.x/testsite8/www/modules/forum/forum.module on line 434.
* notice: Trying to get property of non-object in /work/projects/testsites/drupal/6.x/testsite8/www/modules/taxonomy/taxonomy.module on line 742.
----------------------------------------------------------------------------------------------------------------------------------------------------------------
also the preview shows the preview pane with
"Page 2"
"New Page 2"
and also in the body of the form it shows
"Page 2"
"New Page 2"
Note: i've created a taxonomy vocabulary "Tips & Tricks" and nodes of type Page and Story can be categorized using that vocabulary.
Comment #4
prakashp commentedThe attached patch fixes the problem. Kindly review.
thanks
prakash patel
Comment #5
pwolanin commentedThis situation happens, apparently, for other submit buttons on the node form as well, not just Preview. So, this patch does not fix the problem in a general enough way. It seems the code is fundamentally flwed since it does not consider the node form as a multistep form.
Comment #6
pwolanin commentedA more general approach. Seems to work.
Comment #7
pwolanin commentedAn alternate approach suggested by chx. An even more general fix.
Comment #8
eaton commentedIt works, it's clean, and the sensibly-named helper function is an improvement. Two thumbs up!
Comment #9
chx commentedYes, but we can do even better. I renamed the function to make it more evident that it's a submit function, added rebuild TRUE inside the function which made book_pick_book_submit unneeded. The less, the merrier!
Comment #10
chx commentedSo, I am looking at node_form_submit and 'wow there is more code to be removed!' so there. And even more could be removed but then the extractor would not be able to find the strings to be localized, so I have only lightly touched watchdog and drupal_set_message .
Comment #11
gábor hojtsy- The docs on the book #submit handler are indented one more whitespace then they should be.
- I don't understand what's a "fixed-up node" as referred to in the phpdoc.
- "In the unlikely case something went wrong you will get the same" Reading this sentence, my question is: The same what?
Comment #12
chx commentedI always love when the commiters are picking on comments. As for what's a fixed-up node, well, it's a node that's fixed up. I can't really explain it, I will ask others.
Comment #13
chx commentedPoor book module, it was left out from the aptch.
Comment #14
gábor hojtsyOK, this question might help: what is the different between a not-fixed-up node and a fixed-up node?
Comment #15
pwolanin commentedok, perhaps this comment is better - "fixed-up" just means the form values are processed via the submit handles.
Also, this patch uses the same submit function in upload module - right now uploads fail if JS is disabled. This is a better version of the fix proposed here: http://drupal.org/node/150463
Comment #16
chx commentedYes, yes, YES! Upload module *fixed*!!
Comment #17
pwolanin commentedoops - one flaw. The message "The node could not be saved." was always being displayed.
Comment #18
eaton commentedTested and checked. A pretty clean fix that doesn't do anything nasty. There is one remaining gotcha. If:
1) JS is turned off
2) A file is selected for uploading
3) The attach button is NOT clicked
4) The SUBMIT button NOT the Preview button, is clicked...
The file never gets saved.
I'm of the mind that the non-JS-didn't-click-attach-and-didn't-preview issue is something that should be dealt with separately. This fixes the serious teaser-related preview issues and several others.
Comment #19
eaton commentedWhoops. Given my comments, 'active' was obviously a typo. Or perhaps a 'selecto.' I meant to set this RTBC.
Comment #20
gábor hojtsyThanks for the better documentation! Highly appreciated! Committed!
Comment #21
(not verified) commented