Right now it's possible to hide the Preview button (using Node Form Settings) while also having "require preview" (from node/comment module) set (thus hiding the Save button). The end result is that there will be *NO* button below the form.
Node Form Settings should validate that both of these options are not enabled at the same time and either a) disallow submission of a form with these settings, or b) bring up a confirmation message asking whether the admin really wants to do this (this is more challenging to program).
It might also be good to have some JavaScript-based clues to disallow this as well - for instance an alert message when an admin chooses these "wrong" settings.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | nodeformsettings-709262-2.patch | 2.1 KB | lelizondo |
| #3 | nodeformsettings-709262.patch | 2.25 KB | lelizondo |
Comments
Comment #1
lelizondo commentedI already added some javascript but I'm afraid is not working like I expected since I'm not very good with js, I'll try what you said, but if anyone wants to jump in and help with the js, I'll be glad to receive patches.
Comment #2
eaton commentedI'm whipping something up -- JS to disable/enable the radio buttons is probably less reliable than a validate or submit handler that ensures the incompatible options aren't selected. Perhaps if someone chooses to hide the 'Preview' button, it automatically sets the preview to 'optional' and displays a message on the admin page?
That would work regardless of the JS situation.
Comment #3
lelizondo commentedI've created a patch to solve the Preview button on nodes only, what I'm doing is simple, if the 'Preview button' is set to *Required*, then we force all nodeformsettings_preview_$type variables to 'Enabled' and disable the $form['nodeformsettings']['nodeformsettings_preview'] so the user won't be able to disable the Preview button since is Required now.
Patch is against HEAD so I'm changing the version. Please test while I work on the Comment's preview button.
Comment #4
lelizondo commentedComment #5
lelizondo commentedre-rolled the patch.. review this..
Comment #6
lelizondo commentedthis was fixed months ago.