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.

CommentFileSizeAuthor
fix_message_link.patch406 bytesandrewmacpherson
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Robin Monks’s picture

Status: Needs review » Fixed

Committed to DRUPAL-6; and a new release, 6.x-1.1, has been rolled.

Thanks!
Robin

Status: Fixed » Closed (fixed)

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

  • Commit c916c4b on 5.x-1.x, 6.x-1.x, 7.x-1.x, 7.x-2.x, master, 8.x-1.x by Robin Monks:
    Patch #357567 (Andrew Macpherson)   node/add URL not working....