If a link field is included in a view and uses the "Title, as link" formatter, apostrophes in the title are output encoded ('). A workaround is to hide the link field from display, use the "URL, as pain text" formatter, add the Title field, and rewrite it as a link with the token from the link field.

Patch in #1373588: Use decode_entities() instead of html_entity_decode() does not resolve this issue.

CommentFileSizeAuthor
#4 link.png136.07 KBbyrond
#1 title.png6.71 KBdawehner

Comments

dawehner’s picture

Status: Active » Postponed (maintainer needs more info)
StatusFileSize
new6.71 KB

Manually testing this worked fine on the current 7.x-3.x-dev version, see screenshot
so maybe provide additional information so people can reproduce your issue.

Maybe this is already fixed with 7.x-3.x-dev for you as well.

byrond’s picture

The issue is with apostrophes in the title field. The example you give has an apostrophe in the content.

EDIT: Sorry. I misunderstood your screenshot. I see now that it is the section of the edit view page and not the edit node page.

dawehner’s picture

I just print out the title.

byrond’s picture

Status: Postponed (maintainer needs more info) » Active
StatusFileSize
new136.07 KB

Here is a screencap of the view we had trouble with. We have "news" nodes that have a link field. We have a view that displays the news nodes, and one of the fields it displays is the link field. We have the link field set to "Title, as link". If the title of the node contains an apostrophe, it is converted to "'". I just retested with the latest 7.x-3.x-dev and verified that it is still a problem.

tahiticlic’s picture

This is the l function which is doing that.

You've to use

array("html" => TRUE)

in l attributes argument to avoid it.

webadpro’s picture

Im having the same issue, but its not with a link, but just the title itself.

--

Edit finally, it wasnt views related. I was using a token for my node, and it needed to be full html rather than plain text.

mgifford’s picture

I'm getting this from the title of the view I created. I'll just clone it to remove it but it was annoying. Showed up with the HTMLEntities in blocks and other places making it look bad.

To replicate just clone a view and entitle it "Mike's View". It's not dangerous, but it is ugly.

matmasr’s picture

Version: 7.x-3.x-dev » 7.x-3.3

I have been experiencing similar issues with Views 7.x-3.3. I have a view that is filtering nodes based on a taxonomy term. In that page layout, I have chosen to override the page title with my context argument "%1" which refers to the "taxonomy term with depth" context.
When a taxonomy term has a single quote ', such as "Mom's Day Out", it's displayed as "Mom&#039s Day Out" instead. Also, when the title includes the "&" character is showing up as &Amp; instead. Is there a quick fix to this or am I configuring my view incorrectly ?

citricguy’s picture

@tahiticlic

Can this be done using the UI?

tahiticlic’s picture

I guess no.

Linked25’s picture

I am having this issue as well. Has there every been a fix for this?

thetech249’s picture

Issue summary: View changes

I used this in the tpl file. print str_replace('&', '&', $fields['title']->content);

afoster’s picture

Looks like the same problem happens with read more links too

https://www.drupal.org/node/2374883

francewhoa’s picture

Version: 7.x-3.3 » 7.x-3.11

Same here. We're confirming that this issue is still present in View 7.x-3.11

As a temporary fix, we used the ` character as an apostrophe '

For example Mom`s Day Out

Instead of Mom's Day Out

3dnathaniel’s picture

Priority: Normal » Major

I am having this issue. Views fields that return content with apostrophes/ampersands returns unencoded text.

This seems like a major issue unless there is some workaround out there.

damienmckenna’s picture

Version: 7.x-3.11 » 7.x-3.x-dev