I've set the "Preview Post" in Post Settings to be checked - so that every Create Content form should only shows a "preview" button, and no "Save" button at first.
But, in my Drupal 6.2 install (was 4.7, then 5.7, and now 6.2), after toggling the Preview Post setting just to be sure, I can create all types of content - Blog, Story, Page, Image, etc - without forcing a required preview. I see two buttons "Save" and "Preview", irrespective of the setting of "Preview Post".
This worked fine in 5.7 and 4.7. There are no error messages in the logs when I create content, so the system seems to be installed correctly.
I could not any documentation on whether this behavior has changed, or if there are additional settings that need to made, if anyone has any info, let me know.
Comment | File | Size | Author |
---|---|---|---|
#14 | node_preview_setting_parens.patch | 720 bytes | Gábor Hojtsy |
#2 | node_preview_setting.patch | 677 bytes | dropcube |
Comments
Comment #1
bwooster47 CreditAttribution: bwooster47 commentedI did some digging around in the code.
Drupal 5.7 node module has this code:
in the function node_form_add_preview().
In Drupal 6.2 node module, I can't see code that does a variable_get('node_preview', 0), which seems to indicate that the admin setting for Preview Post would never be taken into account?
The functions have changed between 5.x and 6.x, so I am not sure the right fix for this - but the following code I added to node_form() seems to do the trick - someone more knowledgeable should probably look into this, I added the if statement below to inhibit the Save button:
Comment #2
dropcube CreditAttribution: dropcube commentedThis is an expected behavior that is not working well in HEAD and 6.x, I am setting this to critical so that it get some attention and can be ported to 6.x before the next maintenance release. The patch applies to HEAD.
Comment #3
dawehneri created a module to provide node_preview settings by content typ
i think its sth. which could be in core, or?
Comment #4
Zothos CreditAttribution: Zothos commentedi would love to see per content typ preview in :)
Comment #5
Hinode CreditAttribution: Hinode commentedI agree that is an issue for a node (e.g. post new forum topic), cause here the config in admin/content/node-settings (Drupal 6.2) do not work.
But, just to remember, forum comments is not affected by the settings in that place, rather, that setting was moved to another place: admin/content/node-type/forum (roll down to comment settings).
BTW, the patch above work for me.
Thanks!
Comment #6
catch@dropcube - where is this variable set? It's not in admin/build/types and I'm not sure where else it would be if not there.
Comment #7
dropcube CreditAttribution: dropcube commented@catch: It's at admin/content/node-settings.
I suggest to fix this bug in 6.x and work out a more complete solution for 7.x, i.e. per content type preview settings. Having per content type settings is worth considering, since some content types may require a preview but other not.
There is a 5.x module for that http://drupal.org/project/nodepreview_by_type...
Would be good to include these settings in 7.x core ?
Comment #8
catch@dropcube, sorry, clearly I never look at that page.
Per content type setting makes sense for D7. I can confirm that patch fixes the bug in D6 although I'm not sure why you have to preview again after fixing form errors? Was that in D5? Either way it seems a bit unnecessary - if I fix errors, I want to submit the form usually.
Comment #9
dropcube CreditAttribution: dropcube commented@catch: Yes, it's in D5 this way, in the
node_form_add_preview()
function:For me it makes sense in this way... if you are forcing users to preview before submitting, they should be previewing until all the data is correct (validated)... once validated, Ok, submit it now... Makes sense ?
Comment #10
dropcube CreditAttribution: dropcube commentedI have created an issue to add this feature to 7.x #281437: Per content type node preview setting
Comment #11
catchdropcube: fair enough, not really in scope for this issue anyway. Looks good to go.
Comment #13
dropcube CreditAttribution: dropcube commentedThe patch still applies cleanly.
Comment #14
Gábor HojtsyI've slightly modified the patch to include parenthesis to better show the two conditions. Attached the version I committed to 6.x. I'd suggest you get this into 7.x now and worry about per content type settings later for consistency.
Comment #15
Dries CreditAttribution: Dries commentedI've committed Gabor's patch to CVS HEAD. I still think we need to worry about per content type settings as well as write a test or two.
Comment #16
catchPer content type settings are here: #281437: Per content type node preview setting Not sure where the tests are best put, so leaving open for now.
Comment #17
Tor Arne Thune CreditAttribution: Tor Arne Thune commentedComment #18
jibranI think it is fixed.
This is from
Drupal\node\NodeFormController::actions()
Comment #19
mgiffordComment #33
catchMoving back to fixed against 7.x - the original bugfix was committed 13 years ago, one follow-up is in an already-fixed issue. We've added lots of test coverage since then, and lack of test coverage isn't a bug.