missing ] after element list
| Project: | Nodecarousel |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
My nodecarousel is not showing any items, only the 'Loading...' text. The carousel is tied to a queue which does have items. It worked before, then I replaced some nodes in the queue, which triggered the issue. Likely my own fault -- some formatting error in the node text or something -- but thought the issue would be useful for ppl in the future anyway.
Firebug shows this error:
missing ] after element list
></span></span></h3></div><p><p><em><str...<div class="node-carousel-item"><div claand that line has the following text:
var nc_home_content_carousel_itemList= ['<div class="node-carousel-item"><div class="col-content"><div class="node-carousel-title node-carousel-label"><h3><span class="ie"><span><a href="/content/unified-management-platform">Unified Management Platform</a></span></span></h3></div><p><p><em><strong>What is BigFix's Unified Management...</p><div class="hidden nid">106</div><div class="hidden node-carousel-index">Unified</div></div></div> <!-- col-content, w-25 -->', '<div class="node-carousel-item"><div class="col-content"><div class="node-carousel-title node-carousel-label"><h3><span class="ie"><span><a href="/content/systems-lifecycle-management-0">Systems Lifecycle Management</a></span></span></h3></div><p><p>Managing the “care and feeding” for all the...</p><div class="hidden nid">58</div><div class="hidden node-carousel-index">Systems</div></div></div> <!-- col-content, w-25 -->', '<div class="node-carousel-item"><div class="col-content"><div class="node-carousel-title node-carousel-label"><h3><span class="ie"><span><a href="/content/security-configuration-and-vulnerability-management-suite">Security Configuration and Vulnerability Management Suite</a></span></span></h3></div><p><p>When it comes to security and vulnerability man...</p><div class="hidden nid">30</div><div class="hidden node-carousel-index">Security</div></div></div> <!-- col-content, w-25 -->', '<div class="node-carousel-item"><div class="col-content"><div class="node-carousel-title node-carousel-label"><h3><span class="ie"><span><a href="/content/endpoint-protection-suite">Endpoint Protection Suite</a></span></span></h3></div><p>

#1
looks like the issue is triggered at
What is BigFix's Unified Management...where the apostrophe in the node's content isn't escaped.I fixed the problem with:
$content = check_plain(check_markup($node->content, FILTER_HTML_STRIP));in mymodule_nodecarousel_node().
If there's no better way you can think to handle escaping the node's title & content, then go ahead and close the issue.