Comments

thedut’s picture

Status: Active » Needs review
StatusFileSize
new1.09 KB

Here is a patch fixing this issue.

swentel’s picture

Interesting, I didn't even know we enforced this in Drupal 7 as well.

thedut’s picture

StatusFileSize
new1.09 KB

Here is a new patch : I simply change the error message : from
"Invalid name. Enter a name other than %invalid."
to :
'The human-readable name %name is already taken.' (the one from Drupal 7).

jhedstrom’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

This should have a test to ensure adding and updating works as expected.

nlisgo’s picture

Version: 8.0.0-beta4 » 8.0.x-dev
Status: Needs work » Needs review
Issue tags: -Needs tests
StatusFileSize
new1.3 KB
new2.5 KB
shwetaneelsharma’s picture

Patch "doubloon-on-node-type-human-names-2396141-3.patch" does display the error message for unique machine-readable name and not for human-readable name. However, when user tries to enter an unique name on the same page and save the field, the error message does not disappear. So, this patch fails. Attaching screenshot.

shwetaneelsharma’s picture

Status: Needs review » Needs work
StatusFileSize
new144.81 KB
new145.67 KB

Same problem arises with "doubloon_on_node_type-2396141-5.patch".
A new unique entry is not allowed on the same page once the error is displayed for duplicate machine_readable name. However, an error message for duplicate human_readable name is displayed if the user enters another duplicate name on the error page. Attaching screenshots.
Changing it to Needs work as user should be allowed to add a valid unique entry on the same page.

nlisgo’s picture

Assigned: Unassigned » nlisgo
Issue summary: View changes

I am going to work on trying to improve the test coverage to indicate that the expected behaviour is not happening.

nlisgo’s picture

Assigned: nlisgo » Unassigned
Status: Needs work » Needs review
StatusFileSize
new1.68 KB
new1.58 KB
new2.79 KB

The issue was that the check for a unique human readable name was case sensitive.

I'm uploading a test only patch, a patch with the fix and an interdiff.

The last submitted patch, 9: doubloon_on_node_type-2396141-9-testonly.patch, failed testing.

The last submitted patch, 9: doubloon_on_node_type-2396141-9-testonly.patch, failed testing.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.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.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

joachim’s picture

Anonymous’s picture

Sorry, but i'm not undestand this. I have several types of node with one pretty human name, which available via different roles. Why i must make different human names? Maybe make it like setting option? And why it issue is "Bug report" insead "Feature request"? And why only node, but not all entity?)

20th’s picture

Version: 8.2.x-dev » 8.3.x-dev
Status: Needs review » Closed (works as designed)

I agree with @vaplas that this is not a bug and we should not add this check.

Once a node type is created, its machine name is set in stone and cannot be changed because Drupal internals depend on it. The human-readable name, on the other hand, can be modified freely at any time. So if an administrator creates two types with the same name by mistake, this can be instantly fixed.

Repeated node type names do not have any negative effect on the site but disallowing them will limit possible usecases, like the one @vaplas described.

I will close this issue, please reopen it if you feel that this feature will be advantageous.