While I'm at it, I think it's unnecessary to display the revision log on node creation. The attached patch handles that.
I'm not entirely sure I've done the check in the "correct" way, so feel free to let me know if that's true. Also, I suspect that I need to add the proper testing for this to go through, which I'll have to do later, since I'm running /way/ late, and why I'm marking this as CNW.
Comment | File | Size | Author |
---|---|---|---|
#28 | 308820-28.patch | 2.19 KB | mgifford |
#24 | 308820-24.patch | 1.89 KB | Pancho |
node_revision_not_on_add.patch | 954 bytes | oadaeh | |
Comments
Comment #1
Pasquallewhy do you think it is unnecessary?
Comment #2
oadaeh CreditAttribution: oadaeh commentedI think it's unnecessary because an initial post doesn't have a revision and providing a form for one can be misleading and confusing to people who are new to adding content in Drupal.
It's certainly not a big deal if it doesn't get in, as it's just a bit of a clean up user interface.
Comment #3
oadaeh CreditAttribution: oadaeh commentedUpdating for the 1 line offset, and changing status.
Comment #4
PasqualleMaybe the "Create new revision" checkbox is unnecessary but the "Log message" is useful (and is used) even at node creation, and as I see you are trying to hide both..
Comment #6
desbeers CreditAttribution: desbeers commentedI also find the log message useful for new content, but the checkbox should not be there when creating new nodes. Only problem is that the helptext underneath the textarea is a bit confusing in that case, you're not 'making changes'.
Found some more 'log issues' related to the book.module:
1 - The log-field is not shown if the user has no 'node-administrator' permission and editing a node in the book-outline. The $node->revision is set to '1' in book_node_presave and that's too late. Moved this to book_node_prepare(). Had to change #access and add #disabled in the 'revision-form' in node_form() to show the proper status in the tab when a new revision is forced.
2 - A check in book_node_presave() if $node->log is set is not necessary because node_save() will check that already. Removed it from book_node_presave().
I set the status to 'bug report' because of item 1.
Comment #7
pp CreditAttribution: pp commentedI reviewed this patch.
I don't know how reproduce the bug.
Add authenticated user role "create book" permission and all permissions which book module add the system.
Log in simple user and add book page.
When I add the book page i show:
# Notice: Undefined index: programmed in _form_builder_handle_input_element() (line 1107 of /home/pp/munka/drupal-cvs/includes/form.inc).
# Notice: Undefined index: programmed in _form_builder_handle_input_element() (line 1107 of /home/pp/munka/drupal-cvs/includes/form.inc).
# Notice: Undefined index: programmed in _form_builder_handle_input_element() (line 1107 of /home/pp/munka/drupal-cvs/includes/form.inc).
# Notice: Undefined index: programmed in _form_builder_handle_input_element() (line 1107 of /home/pp/munka/drupal-cvs/includes/form.inc).
# Notice: Undefined index: programmed in _form_builder_handle_input_element() (line 1107 of /home/pp/munka/drupal-cvs/includes/form.inc).
...
I don't know is this bug or other?
Comment #8
desbeers CreditAttribution: desbeers commentedThose notices came from #322344: (notice) Form improvements from Views and are not created because of this patch.
Comment #9
Bojhan CreditAttribution: Bojhan commentedWhat about not showing a checkbox, and only filling it in when you want to - thereby creating a revision,
Comment #10
desbeers CreditAttribution: desbeers commentedIt's a very good idea but a few points:
I'll give it a try Bojhan, thanks for the suggestion!
Comment #11
Bojhan CreditAttribution: Bojhan commentedNo, but what about if it is empty we simply do nothing to the DB (like we do now, without the checkbox marked). And when someone did enter something - it creates a revision. I think it will make more sense, then showing a create revision checkbox. I am unsure if it is apperant that one does not need to fill this out, but it is not marked required.
Comment #12
cburschkaI'm concerned about mixing a database decision as momentous as determining whether to use revisions or overwrite, with a field essentially intended for comments. You don't see CVS creating new branches based on what you put in the commit message. ;) It would be highly confusing, especially if you were in the habit of creating revisions on your single-user site withou leaving log messages.
This patch forces a new revision on ever node type for non-administrators when book is enabled. Regardless of whether the node in question is part of a book hierarchy or not.
Comment #13
DarkLight CreditAttribution: DarkLight commented#6: node-book-log-1.patch queued for re-testing.
Comment #15
not_Dries_Buytaert CreditAttribution: not_Dries_Buytaert commentedI submitted the same issue for D6: http://drupal.org/node/915766
Comment #16
thoughtcat CreditAttribution: thoughtcat commentedI agree that it is confusing for editors to get a field at the bottom of the submit form saying "Provide an explanation of the changes you are making" when they are first creating a node. You're not making any changes. I don't want to turn off "create new revision" for the content type because that turns off the log message field for when you are making changes. This doesn't make sense to me!
Comment #17
bleen CreditAttribution: bleen commentedThis has driven me nuts for years ...
I believe that we shouldn't display the revision tab at all when creating a new node. This patch does exactly that. Lets see what testbot thinks.
Comment #19
Bojhan CreditAttribution: Bojhan commentedI agree, the patch seems to fail.
Comment #20
bleen CreditAttribution: bleen commentedThis should pass ... I changed the "preview" test to test when editing a node instead of creating a node so that the revision log could still be tested on preview
Comment #21
PanchoIn D8, we'll probably get a completely new interface for node creation. So if we fix this, then mostly in respect to D7.
There again we need to be extra careful before removing used functionality. So removing the log on node creation might break existing workflows. The checkbox should go though.
However, the patch obviously doesn't apply anymore.
Comment #22
bleen CreditAttribution: bleen commented#20: 308820.patch queued for re-testing.
Comment #24
PanchoA quick, untested patch without test coverage.
Comment #25
PanchoNeeds to be thoroughly checked, as it doesn't seem to be covered by any test.
Comment #26
drummComment #27
mgiffordPatch no longer applies.
Comment #28
mgiffordcore/modules/node/lib/Drupal/node/NodeFormController.php no longer exists. I assume this is now provided in:
core//modules/node/lib/Drupal/node/NodeForm.php
EDIT: I probably shouldn't have included
$form['log']
but who writes log messages on a new node?Comment #32
BerdirThis was fixed in #2744877: Node add form shows 'create new revision' checkbox