Closed (fixed)
Project:
Drupal core
Version:
8.3.x-dev
Component:
node system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
8 Jun 2016 at 13:36 UTC
Updated:
25 Oct 2016 at 20:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
yoroy commentedI *suspect* this should be relatively easy to jump into and write a patch for.
So the task is: don't show the "Create new revision" checkbox on the content creation form
Comment #3
kamalrajsahu21 commentedOn first time checking the node revision checkbox and saving the node, shows a new tab "Revisions". If we again edit the same node and do not check the revision checkbox then this node update entry would not be saved in the node_revision table and hence will not be shown under "Revisions" tab.
Comment #4
lucur commentedComment #5
katzillaComment #6
biancajs commentedComment #7
biancajs commentedHide revision checkbox on node add form by checking if node is new.
Comment #8
gábor hojtsy@kamalrajsahu21: right, but what about the first revision, how could you skip that? :)
Comment #9
kamalrajsahu21 commented@Gábor Hojtsy: We can't skip that as this will be needed for first time just for backup of node.
Comment #10
gábor hojtsy"We can't skip that as this will be needed for first time just for backup of node." Can you explain what would be different step by step for the two cases, I am afraid I am not getting it.
Comment #11
yoroy commentedNot showing the UI bits for revisions on *initial* node creation does not mean the node can't be saved. We just don't show a part of the UI that is not relevant at that time.
Comment #12
catchUnnecessary whitespace addition.
For form alters etc. it's more predictable to do
$form['revision']['#access'] = !$node->isNew()than to conditionally add the declaration.Comment #13
katzillaChanged the code according to #12 - thanks for the hint.
Comment #14
katzillaComment #15
romainj commentedShould we hide the Revision log message too? It has no more purpose on node creation.
Comment #16
lucur commented@romainj Since there is created a revision automatically on node creation the log message could be still useful.
Comment #17
romainj commented@lucur agree even if I never use the message on new node.
Comment #18
katzillaRe-uploading patch because test wasn't triggered.
Comment #19
gábor hojtsyLooks good. Needs tests AFAIS.
Comment #21
katzillaok, working on a test now.
Comment #22
dietmarg commentedworking on it with katzilla
Comment #23
dernetzjaeger commentedComment #24
dernetzjaeger commentedWorked on that with @katzilla and @dietmarg at DrupalCon Dublin mentored by @chipway. :)
We added the simpletest in
NodeCreationTest.phpto the patch as @gábor-hojtsy suggested.Comment #25
chipway commentedThank you for the past couple of patches.
Could you provide an interdiff between the patches from #13 to #24? An interdiff helps reviewers look at the changes between patches and makes it easier to check the intended changes from what you worked on.
Comment #26
dernetzjaeger commentedSure @chipway :)
Comment #27
chipway commentedThank you @katzilla, @dernetzjaeger and @dietmarg for you work.
I tested node_add_form_shows-2744877-24.patch following https://www.drupal.org/patch/review. Here are my findings and suggestions:
Patch addresses the issue (see screenshots) and stays within scope of the issue, and added simpletest seems accurate.
Could you delete the 6 last lines which are out of scope?
diff --git a/sites/default/default.services.yml b/sites/default/default.services.yml
old mode 100644
new mode 100755
diff --git a/sites/default/default.settings.php b/sites/default/default.settings.php
old mode 100644
new mode 100755
To make this patch more comprehensive, I would suggest to remove the "Revision log message" field. See Create_Article_Drupal_-_2016-10-04_21.40.27_without-patch-2744877-24_suggestion.png
Comment #28
dernetzjaeger commentedRemoved the last lines. Don't know why that got into the patch. As I usually set
git config core.fileMode false.I added patch + interdiff again. :)
Thanks for the suggestion to also remove the log message input in that patch. But in my eyes it shouldn't. As in #15 and #16, I would prefer a further discussion on that in a new issue and set that one as related.
Comment #29
gábor hojtsyWording issue with the assertion:
is not present :)
Is there a positive test that it is present later on? (I would assume there is a UI test for that, but not sure).
Comment #30
gábor hojtsyComment #31
chipway commentedThanks @Gábor Hojtsy for your help,
What is your advice about hiding "Revision log message" field in this issue or discussing this point in a new related issue?
Comment #32
gábor hojtsyI think a different issue would be good for that. You may still want to provide a log message for your first revision, I think that makes sense in some situations, so better discussed in a separate issue. On the other hand the first revision is a new revision anyway, so the checkbox is truly pointless :)
Comment #33
chipway commentedThanks @Gábor,
I added issue https://www.drupal.org/node/2811549 to discuss the opportunity to hide "Revision log message" field when we create a new node.
So we can go ahead with the current issue.
Comment #34
dernetzjaeger commentedThanks @gábor-hojtsy, changed wording.
Comment #35
gábor hojtsyOk, what about my other note in #29?
Comment #36
katzillaWe checked, but there was no test. Added test in NodeEditFormTest.php now.
Comment #37
chipway commentedI tested node_add_form_shows-2744877-36.patch following https://www.drupal.org/patch/review.
Patch applies on 8.3.X, addresses the issue (see screenshots still valid) and stays within scope of the issue. Added test in NodeEditFormTest.php seems to address comment #35.
I read the patch and looks clean.
Comment #38
chipway commentedTo be comprehensive and fussy, PHP CodeSniffer gives few Errors in your patch:
FILE: .../core/modules/node/src/Tests/NodeEditFormTest.php
116 | ERROR | [x] Concat operator must be surrounded by a single space
117 | ERROR | [x] Space found before comma in function call
Would suggest changing them to:
$this->drupalGet('node/' . $node->id() . '/edit');
$this->assertFieldById('edit-revision', NULL, 'The revision field is present.');
Comment #39
katzillaadded a new patch - thanks for the hint :)
Comment #40
gábor hojtsyLooks good to me, has all the tests needed, nice little usability improvement :)
Comment #41
katzillayay - that was quick in the end! Thank you :)
Comment #42
webchickLooks like a nice little usability improvement, thank you!!
Reviewed on weekly UX meeting, and committed and pushed to 8.3.x. Thanks!
Comment #44
gábor hojtsyYay, congrats all!