This is a hack, but I can't seem to get titles fields only to print in plaintext (so that quotes show up as quotes instead of code). Here are the modules that I applied and tested in hopes that it would fix this problem:

Since there's no obvious solution, I hacked this module to decode when the field id is title. Not pretty, I know. But it works, and maybe this is something that can help other people in my position. Obviously I don't expect this to be accepted by the maintainer, but perhaps someone will wander across this issue and figure out a less hacky solution. :-)

views_datasource/views/theme/views_views_json_style.theme.inc: Line 50:

      /*
       * HACKING THIS MODULE TO MAKE TITLE PLAIN TEXT
       */
      if ($field->id == "title"){
        $field->content = htmlspecialchars_decode($field->content, ENT_QUOTES);
      }
      /* END HACKING THIS MODULE */

My hack is relative to json, but I imagine this could apply to others if you hack those files as well.

CommentFileSizeAuthor
#1 decode_entity_labels-2013226-1.patch1.52 KBAnonymous (not verified)

Comments

davidneedham’s picture

Issue summary: View changes

Updated issue summary.

Anonymous’s picture

Issue summary: View changes
StatusFileSize
new1.52 KB

I created a patch to do a similar, but more involved field check in _views_json_render_fields(), which fires before template_preprocess_views_views_json_style_simple() where you made your changes.

kriskhaira’s picture

@rsmylski's patch works for me

rudetrue’s picture

I think the patches above will still leave '&', '<' and '>' encoded.

yannickoo’s picture

Assigned: davidneedham » yannickoo

Will work on this tomorrow :)

  • yannickoo committed f30935a on 7.x-1.x authored by rsmylski
    Issue #2013226 by rsmylski | davidneedham: Make all title fields print...
yannickoo’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev
Assigned: yannickoo » Unassigned
Status: Active » Patch (to be ported)

Cool patch! As you can see following happens:

Current result

"<a href=\"/yannicks-website\">Yannick&#039;s &lt;new&gt; &amp; &quot;website&quot; :/</a>"

With applied patch

"<a href=\"/yannicks-website\">Yannick's <new> & \"website\" :/</a>"

anthonylindsay’s picture

Status: Patch (to be ported) » Closed (outdated)

Closing as no activity for two year, it's in D7 and D6 unsupported.