field_ui_menu_load() needs the same hack as node_type_load() in order to translate dashes in URL to underscores in content type machine name.

Attached patch fixes this oversight.

CommentFileSizeAuthor
field_ui_menu_load.patch709 bytesmatt2000

Comments

matt2000’s picture

To clarify, this is critical because several required field ui pages return 'page not found' for paths containing content type names with underscores.

Another way to deal with this would be to get rid of the convention that disallows underscores in paths, and references content types in paths by their actual machine name, but maybe that exists for reasons beyond my understanding.

sun’s picture

Nice catch.

I have no clue why those path argument conversions exist. They prevent you - without any valid technical reason - from having a content type that uses a hyphen (while only module defined content types can't use a hyphen).

Clearly, pretty paths are the domain of URL aliases, and this conversion adds nothing than countless of totally awkward code lines to core and contrib. So +1 for removing it altogether.

However. Removing that conversion will require plenty of tests to be changed accordingly, so I'd recommend to wait for a sign-off from core maintainers before starting to work on that direction.

sun’s picture

Status: Needs review » Reviewed & tested by the community

Bumping to get some core maintainer awareness.

yched’s picture

Agreed on the RTBC, this is an overlook.

I'll also add that, as a CCK maintainer, I've been wondering about that '_' / '-' convention in URLs for more than two years (er, under the assumption that 'ah, some wise people probably know the reason...') ;-)

matt2000’s picture

The Emperor has no clothes!

Here's an issue for Drupal 8: #617562: Remove underscore-to-dash conversion in path arguments for content types

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Heh, this underscore-to-hyphen thing was asked for by Dries back when the node type part of CCK first got into core in D5. I don't fancy breaking everyone's URLs at this point, so agree with moving this discussion to D8.

In the meantime, committed this fix to HEAD.

Status: Fixed » Closed (fixed)

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