Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have a node title "SHOW & TELL".
In the quicktabs tab (I'm using class quicktabs) it displays incorrectly as "SHOW & TELL"
The title in the display of the node itself (generated by Views module) does display correctly.
Comment | File | Size | Author |
---|---|---|---|
#16 | 1302760-quicktabs-html-decode-16.patch | 385 bytes | lunazoid |
| |||
#10 | 1302760-quicktabs-title-double-encode-fix.patch | 708 bytes | davidwhthomas |
#4 | quicktabs.htmlentities.patch | 566 bytes | ivrh |
Comments
Comment #1
cpelham CreditAttribution: cpelham commentedCorrection: Quicktabs is incorrectly displaying it as & instead of as &
How can I get the & to display correctly?
Comment #2
cpelham CreditAttribution: cpelham commentedThis seems like it would be pretty straight-forward to fix but I just don't know enough to code it myself. Does anyone have any ideas?
Comment #3
cpelham CreditAttribution: cpelham commentedOK, this is also a problem with apostrophes and likely with other characters that would get escaped. How are other people dealing with this? It is so ugly! I don't know how other people can stand it.
Comment #4
ivrh CreditAttribution: ivrh commentedThe issue with htmlentities is not related to the module, but rather with the way drupal handles links (via l() function) and translations (via t() function).
The patch attached resolves the issue with htmlentities for those of you who really need to display symbols instead of html code.
Comment #5
simeThis patch has been working well for us.
Comment #6
sime... on latest version that is
Comment #7
Liam MorlandThis might be caused by #2011918: Titles are often double-escaped (including in the content attribute of the dc:title meta element for nodes).
Comment #8
netw3rker CreditAttribution: netw3rker commentedCan I get confirmation that this is still an issue, I can't reproduce it at all. If i can get some concrete steps to reproduce it and this patch fixes it, i'll apply it.
Comment #9
netw3rker CreditAttribution: netw3rker commentedComment #10
davidwhthomas CreditAttribution: davidwhthomas commentedI just had this double ampersand encoding issue myself when using the 'callback' method to populate the quicktab.
I had a look and it turns out quicktabs is double escaping the page title (and hence breadcrumb title)
This is because it uses drupal_get_title to store the title, which passes it through check_plain
It then calls drupal_set_title which check_plain's the escaped title again.
The attached patch prevents the double encoding in drupal_set_title when using the 'callback' method of populating quicktab content.
Comment #11
capfive CreditAttribution: capfive commentedthis happens for me even with the patches applied, here are the steps to reproduce
1. create view of taxonomy displayed using quicktabs
2. add taxonomy name and and content for example
3. anything with an Ampersand comes out as
&
Driving me nuts! please help!
Comment #14
capfive CreditAttribution: capfive commentedI managed to get this fixed.
So where the view is being built I applied the same
<?php html_entity_decode() ?>
function to get it to decode the view title.Here is the change i applied as I don't know how to create a patch!
In sites/all/modules/quicktabs/includes/quicktabs_style_plugin.inc
Line 122
<?php 'title' => $title, ?>
-- 'title' => $title,
++ 'title' => html_entity_decode($title)
Here is the code in context
I also applied the same to the single row setup
Happy coding!
Comment #15
jessZ CreditAttribution: jessZ commentedI have this problem as well. Titles displayed on the same page where a quick tab is enabled display ampersands and smart quotes incorrectly. Has this been fixed in 7.x-3.8 I have 7.x-3.6 installed. Will updating the module fix this?
Comment #16
lunazoid CreditAttribution: lunazoid as a volunteer commentedI was having this problem with quicktabs 3.8. The patch by @capfive would fix the tab title text, but we were also using an image field to have icons on the tabs. By default, quicktabs was rendering the image as the html text. This patch decodes the generated output before returning, which seems to fix the issues in my case.