Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Everyone keeps saying, "I always wondered about that, but figured some smart person decided it for a reason..."
Comment | File | Size | Author |
---|---|---|---|
#19 | drupal8.node-type-url.19.patch | 37.96 KB | matt2000 |
#17 | drupal8.node-type-url.17.patch | 37.81 KB | matt2000 |
#15 | drupal8.node-type-url.15.patch | 30.21 KB | sun |
#13 | drupal8.node-type-url.13.patch | 28.26 KB | sun |
#11 | drupal8.node-type-url.11.patch | 28.27 KB | sun |
Comments
Comment #1
matt2000 CreditAttribution: matt2000 commentedThis was born from: http://drupal.org/node/617532#comment-2203464
Comment #2
sunUltimately, I'd like to see this fixed as part of #617532: field_ui menu paths doesn't translate underscores in content type names, since this is a fake limitation (and therefore a bug) that never made any sense.
Comment #3
yched CreditAttribution: yched commentedWouldn't it break links on existing Views using a 'node:type' argument after a D6 -> D7 upgrade ?
Comment #4
sunwebchick overruled the timeline, but provided some background info:
Comment #5
sunHowever, this totally awkward conversion of internal ids can cause a range of unexpected bugs. Identifiers should be unique and not munged in any way.
So let's fix this.
Comment #6
yched CreditAttribution: yched commentedMarked #605236: Content type - bundle realname not using machine readable name as duplicate.
I'm not sure I see which clashes you expect. node type names only allow 'a-z_', so converting '_'s to '-'s should not cause any conflict.
Comment #7
sun.core CreditAttribution: sun.core commentedComment #8
Damien Tournoud CreditAttribution: Damien Tournoud commentedOnly feature requests and tasks can be assigned to D8 for now, because the Drupal 8 tree is not opened yet.
Fortunately, this is a feature request :)
Comment #9
klausiSubscribing, why did we introduce this conversion in the first place? Is a '-' in a URL prettier than a '_'?
Comment #10
sunAny takers? This should be relatively simple (just grep entire core for the string replacement and remove them all), so tagging as Novice.
Comment #11
sunKick-starting this, 'cos I can't stand this bogus beautification anymore.
Comment #13
sunCreated follow-up issue for #1564832: Remove _node_extract_type() and node_type_get_name() (postponed on this one)
Comment #15
sunFixed the exceptions.
Comment #17
matt2000 CreditAttribution: matt2000 commentedHere's a new patch with fixes for the broken tests. (That is, the new code has not changed; instead this patch only includes updates to old tests that try to get a 'test-bundle' url instead of the new 'test-bundle'.)
Comment #19
matt2000 CreditAttribution: matt2000 commentedI guess my patch generation method needs updating... Let's try this one.
Comment #20
sunwoot! Thanks a lot @matt2000!
@chx requested in IRC to dig out why this conversion exists in the first place. Answer: Purely cosmetic.
Introduced in the initial commit for custom node types for D5: #62340-91: Pave the way for CCK
And even back then, a lot of discussion followed on that "beautification" detail already (search the issue for "dash"). :(
Comment #21
chx CreditAttribution: chx commentedOK then.
Comment #22
catchOooh I'd not seen this issue. Committed/pushed to 8.x, will need a change notification.
Comment #23
tim.plunkettOpened two change notices:
http://drupal.org/node/1574668
http://drupal.org/node/1574670
Comment #24
sunThanks! I've revised both a bit.
Comment #26
joachim CreditAttribution: joachim commented> Is a '-' in a URL prettier than a '_'?
Yes. Much.
Wish I'd seen this ages ago, as this would have got a big fat -1 from me :(
Comment #27
matt2000 CreditAttribution: matt2000 commented@joachim
The bigger issue, IMO, is consistent Developer experience. The conversion is an unneeded WTF. So a follow-up patch to change the entity machine name convention to use dashes instead of underscores would be fine with me -- but I'd expect more resistance from others by going in that direction, as it seems to me it would have much more far reaching consequences than standardizing the URLs this way.
Comment #28
joachim CreditAttribution: joachim commentedIt's a big change to user-facing parts of Drupal that seems to have gone through without that much discussion.
I feel there are much bigger, further-reaching WTFs in Drupal. I for one have never been tripped up by this one. You're either dealing with a path argument or making a URL --> use a hyphen, or you're dealing with $info and the database --> use an underscore. The only places you need to go from one system to the other are menu loaders, which I would hope in D8 are unified to just one grand entity_load(), and making links, where we could have added a helper function.