Closed (works as designed)
Project:
Drupal core
Version:
8.3.x-dev
Component:
node system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
19 Dec 2014 at 13:45 UTC
Updated:
17 Nov 2016 at 17:03 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
thedut commentedHere is a patch fixing this issue.
Comment #2
swentel commentedInteresting, I didn't even know we enforced this in Drupal 7 as well.
Comment #3
thedut commentedHere 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).Comment #4
jhedstromThis should have a test to ensure adding and updating works as expected.
Comment #5
nlisgo commentedComment #6
shwetaneelsharma commentedPatch "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.
Comment #7
shwetaneelsharma commentedSame 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.
Comment #8
nlisgo commentedI am going to work on trying to improve the test coverage to indicate that the expected behaviour is not happening.
Comment #9
nlisgo commentedThe 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.
Comment #14
joachim commentedComment #15
Anonymous (not verified) commentedSorry, 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?)
Comment #16
20th commentedI 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.