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.
Hi,
I've found a minor bug in the links which are generated in the warning message when anonymous visitors cannot leave their contact details. The problem occurs when the content type name contains an underscore. These should be converted to hyphens when generating the admin link, as is done, for example, in content_types_overview() in cck/includes/content.admin.inc
Attached is a patch against 1.4
Thanks for creating the comment_notify module. This is exactly what I was looking for.
Jonathan
Comment | File | Size | Author |
---|---|---|---|
#4 | d7 comment notify link with underscores.jpg | 247.93 KB | jonathan1055 |
_comment_notify.underscore_in_content_type.patch.txt | 1.14 KB | jonathan1055 |
Comments
Comment #1
gregglesLooks good to me. I'll try to test/apply soon. Thanks!
Comment #2
jonathan1055 CreditAttribution: jonathan1055 commentedJust in case you were wondering why I split the change over two lines when it could have been done in one, this is because I have extended the information shown and use $type_url_str in more places, to give links to the admin settings for each type. I will submit that next - did not want to include a bug-fix and an enhancement in the same patch (been told off for doing that before!)
Jonathan
Comment #3
gregglesFixed - thanks jonathan1055! http://drupal.org/cvs?commit=390498
It looks like this affects the Drupal 7 version as well. Could you "port" it?
I'd also be interested in your patch that fixes the other issue you mention.
Comment #4
jonathan1055 CreditAttribution: jonathan1055 commentedI've just tested this with a D7 alpha6 site. Something clever is happening with the interpretation of the menu path because links to content types with underscores now work fine, as do links with hyphens. See the attached screen grab showing a link to a content type with underscores - clicking the link shown results in localhost:8888/drupal_7/#overlay=admin/structure/types/manage/type_with_underscores which shows the required page.
So this patch is not actually needed in D7 (at least it appears not in the testing I've done). Therefore the choices are:
I read a useful post by Dries, linked from http://drupal.org/node/65922, which suggests that we should not drag baggage to a new release. So I favour option 2 but I would be happy to go with your preference.
Jonathan
Comment #5
Dave ReidIt's because the menu link loader for node types in D7 auto-converts dashes back to underscores. Core itself uses links with just the node type un-altered, so that's what we should do too. I think the existing comment is good enough in D6, so marking back to fixed for D6.
http://api.drupal.org/api/function/node_type_load/7
Comment #6
jonathan1055 CreditAttribution: jonathan1055 commentedThanks for the background info Dave. At first glance, the header comment in D7 node_type_load() was confusing as it appeared to be the wrong way round:
Then I worked out what it means is that the $name parameter has already had underscores changed to hyphens, and these will be changed back to underscores by the strtr code in