On NodeTypeForm, the following description is incorrect:

Users with the Administer content permission will be able to override these options.

see the screenshot..

At least the "Create new revision" is not related to the Administer content permission.

\Drupal\Core\Entity\ContentEntityForm::addRevisionableFormFields()

$form['revision'] = [
  '#type' => 'checkbox',
  '#title' => $this->t('Create new revision'),
  '#default_value' => $new_revision_default,
  '#access' => !$this->entity->isNew() && $this->entity->get($entity_type->getKey('revision'))->access('update'),
  '#group' => 'revision_information',
];

This checkbox can be edited by anyone, as Drupal core does not apply any access restriction on this field (with hook_entity_field_access())

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Pasqualle created an issue. See original summary.

bhanuprakashnani’s picture

@Pasqualle

I have understood that we have to correct some incorrect text. So what is the next step to continue with the bug report? Please assist me.

cilefen’s picture

bhanuprakashnani’s picture

Assigned: Unassigned » bhanuprakashnani
ankitjain28may’s picture

I would like to fix this.

ankitjain28may’s picture

What should be the correct help text so i can write a patch ?

bhanuprakashnani’s picture

Please give the correct text to be updated over there. Waiting for the reply. Patch will be uploaded as soon as I get the correct text. Thank you.

Pasqualle’s picture

There is no "correct" text. Check the codebase, and suggest a better description, and we can discuss if it is good or bad.

ankitjain28may’s picture

This is the most appropriate patch.

Status: Needs review » Needs work

The last submitted patch, 9: Incorrect-help-text-2946177-9.patch, failed testing. View results

Pasqualle’s picture

There is no permission named "content". You made the description even worse..

joachim’s picture

> 'Users with the Administer content permission will be able to override these options.

Is there even one and only one permission that can be used here?

If not, we have two options:

a. say something general and vague, like 'Users with sufficient access rights will be able to override these options.'

b. add a description to each checkbox instead of to the checkboxes as a whole.

cilefen’s picture

This is just opinion, but: Why show any help text there? Drupal doesn't routinely point out things you could do if you only had the permission.

ankitjain28may’s picture

Status: Needs work » Needs review
FileSize
1.67 KB

As stated in comment #13, I have updated the text.

joachim’s picture

The patch looks a little broken...

+++ b/core/modules/node/src/NodeTypeForm.php
@@ -154,7 +154,7 @@ public function form(array $form, FormStateInterface $form_state) {
+      '#description' => t('Users with <em>sufficient access</em> rights will be able to override these options.'),

Also, the EM tag here was because it was the name of a permission. We don't need to emphasise something that's just words.

mohit1604’s picture

Did changes as per comment#15.

ankitjain28may’s picture

Patch #16 looks good to me and as expected in #15

ankitjain28may’s picture

FileSize
729 bytes

Interdiff of patch #14 and #16

bhanuprakashnani’s picture

Please review the patch. I have already done this but didn't upload it.

Status: Needs review » Needs work

The last submitted patch, 19: 2946177-19.patch, failed testing. View results

bhanuprakashnani’s picture

Status: Needs work » Needs review

sry for the wrong patch. got some unexpected errors. will correct them.

ankitjain28may’s picture

The patch in #14 was bit broken fix that in this patch.

Pasqualle’s picture

What you 2 guys doing here is really disturbing. I did not find anything related to your behavior in the d.o documentation, but let me give you my friendly advice:
- work in cooperation, this is not a competition
- understand the problem
- do not assign the ticket to yourself, core committer knows who worked on the patch. Assignment is only necessary if the problem require long time (like weeks) to solve and you are really working on it
- do not create interdiff patch for a small patch like this
- do not create a new patch (without any explanation) when there is one already for review
- do not blindly upload something, check that the patch is working
- too much comments without real value can be considered as spam

Pasqualle’s picture

joachim’s picture

> - understand the problem

This, and also discuss the problem!
I proposed *two* possible solutions. The merits of each one should be discussed before we post patches!

ankitjain28may’s picture

@Pasqualle I am really sorry for my behavior, i will keep this in mind.
@joachim as @cilefen stated in #13 is much appropriate in my point of view, There isn't any need to put the help text there if it isn't pointing to anything.

bhanuprakashnani’s picture

@Pasqualle
Pardon me for my actions. Would never do this again.

Pasqualle’s picture

Hey, no problem. Don't let anyone stop you contributing to Drupal and open source..

joachim’s picture

Status: Needs review » Needs work

OK let's set this back to 'needs work'.

We need to discuss the merits of the two options I proposed in #12.

Is it feasible to list permissions for each of the checkboxes? Can anyone go through the node form and check what they are?

ifrik’s picture

Version: 8.5.x-dev » 8.6.x-dev

Thanks Joachim,
I think we are safer in going with the first of the two options proposed in #12.
The main point about this description is to alert users that even though some default options are chosen, some users might nonetheless have the option to change this to something different. So the sitebuilder knows that they can set defaults that are not set in stone, and they also won't be surprised if user 1 or other users are able to change the settings even when they thought they were set here.

With further workflow option or so, other modules might add more checkboxes here, so a general description to alert the site builder would be future-proof.

Dinesh18’s picture

I agree with @ifrik, First option mentioned in #12 is much better approach and cleaner.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Rithesh BK’s picture

Assigned: Unassigned » Rithesh BK
Rithesh BK’s picture

Assigned: Rithesh BK » Unassigned
Status: Needs work » Needs review
FileSize
201.01 KB

@Pasqualle i have tested the 2946177-16-D8.patch from #16 for 8.9.x-dev version. it is working fine. Please find the attached screenshot ...

Pasqualle’s picture

Status: Needs review » Reviewed & tested by the community

I agree, #16 looks good.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: +String change in 8.9.0

Committed and pushed a56410bf7b to 9.0.x and 5a2738738e to 8.9.x. Thanks!

  • alexpott committed a56410b on 9.0.x
    Issue #2946177 by ankitjain28may, bhanuprakashnani, mohit1604, Pasqualle...

  • alexpott committed 5a27387 on 8.9.x
    Issue #2946177 by ankitjain28may, bhanuprakashnani, mohit1604, Pasqualle...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.