Convert &amp in nodereference titles to Ampersand

Created on 30 November 2011, almost 14 years ago
Updated 12 March 2024, over 1 year ago

When listing nodes in a view and then using it as a viewselect field, any Ampersand (&) characters are converted to HTML entities (&amp). So in your views select field will have 'Ketchup &amp Mustard' instead of 'Ketchup & Mustard', for example.

The simple fix (if someone can make a patch, that'd be great):

// $Id: viewselect.inc,v 1.2 2010/03/19 15:12:17 freakalis Exp $
starting at line 647

  foreach($data as $index => $row) {
    //$options[$index] = check_plain($row['title']); 
    $options[$index] = html_entity_decode(check_plain($row['title']), ENT_QUOTES);
  }

Hope this helps, and it should be rolled into the next update. Please let reply here if you have issues with it, so it can be pushed to the next update if all is well.

Great module. Thank you.

🐛 Bug report
Status

Active

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

No activities found.

Production build 0.71.5 2024