This is a great module! It's more elegant than Submit Again, I think.
However, the link which appears in the message area is not always correct. A problem occurs when the node type's machine-readable name contains an underscore. Drupal converts the underscore to a hyphen in the node/add path URL, but the module leaves the underscore alone. It's not a problem for node-types with a one-word name, like 'page' or 'story'.
e.g. For a Performance Venue node-type we might have:
human-readable name = 'Performance Venue'
machine-readable name = 'perf_venue'
The message should link to 'node/add/perf-venue
', but the module currently links to 'node/add/perf_venue
', which of course doesn't work. It just lands us on 'node/add
'.
Replace addanother.module
(line 78)
drupal_set_message(t('Add another <a href="@typeurl">%type</a>.', array('@typeurl' => url('node/add/'. $node->type), '%type' => $node->type)));
With:
drupal_set_message(t('Add another <a href="@typeurl">%type</a>.', array(
'@typeurl' => url('node/add/'. str_replace('_', '-', $node->type)),
'%type' => node_get_types('name', $node)
)));
Note: this also gives the link text the nicer human-readable name.
Comment | File | Size | Author |
---|---|---|---|
fix_message_link.patch | 406 bytes | andrewmacpherson | |
Comments
Comment #1
Robin Monks CreditAttribution: Robin Monks commentedCommitted to DRUPAL-6; and a new release, 6.x-1.1, has been rolled.
Thanks!
Robin