Weird TPL error
Hello Expert,
My TS version 16.6.1.1 installed o RHEL 7.7.
We recently migrated from TS 7.5 to TS 16.6.1.1. We still using TPL file to generate html files. After the upgrade we were facing this very weird issue where extra content can be seen on generated HTML pages after removing some content from DCR. There were few old PERL module issue I fixed but I am not able to debug this issue. Below is code which we are using to generate HTML files:
<iw_comment>Free-form text content</iw_comment>
<iw_case type='text'>
<iw_perl><![CDATA[
my $textContent = iwpt_dcr_value('contentElement');
if ((defined $textContent) && ($textContent !~ /^\s*$/)) {
my $myCopy = $textContent;
$textContent = $ptHandler->cleanseText($pageName, $textContent);
if (! defined $textContent) {
$textContent = $myCopy;
}
}
]]></iw_perl>
<iw_value name='$textContent'/>
</iw_case>
cleanseText function from PTHandler.pm
sub cleanseText {
# Get parameters
my $this = shift;
my $pagePath = shift;
my $textContent = shift;
my $cleansedText = '';
my $tree;
$tree = HTML::TreeBuilder->new;
$tree->parse($textContent);
my @allLinkTags = $tree->find_by_tag_name('a','map');
foreach my $tag (@allLinkTags) {
my $href = $tag->attr('href');
# If href attribute exist and pagePath been passed
if ( (defined $href ) && (defined $pagePath) ) {
# Fix the link
my $link = &fixLink($this, $href, $pagePath);
# If able to fix the link
if (defined $link) {
# Replace the href attribute with the fixed link
$tag->attr('href', $link);
}
}
}
$cleansedText = &trimHtml($tree->as_HTML(undef, ' ', {} ));
$cleansedText =~ s/<br>/<br\/>/sg if ($cleansedText =~ /<br>/);
#print STDERR "cleanseText OUPUT: " . $cleansedText . "\n";
return $cleansedText;
}
Please help me to debug this issue because I have tried all my perl and tpl knowledge but could not find the root cause itself.Thanks in Advance,
Niraj
Tagged:
0
Comments
-
This issue has been addressed in the Teamsite v16.6.1.2.
It is released on 12th October, https://knowledge.opentext.com/knowledge/llisapi.dll/Open/78121214
Regards,
Kiran0
Categories
- All Categories
- 108 Developer Announcements
- 53 Articles
- 106 General Questions
- 144 IM Services
- 43 OpenText Hackathon
- 32 Developer Tools
- 20.6K Analytics
- 4.1K AppWorks
- 8.9K Extended ECM
- 899 Cloud Fax and Notifications
- 77 Digital Asset Management
- 9.3K Documentum
- 29 eDOCS
- 120 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
TeamSite Developer Resources
If you are interested in gaining full access to the content, you can register for a My Support account here.
- Docker Automation
- LiveSite Content Services (LSCS) REST API
- Single Page Application (SPA) Modules
- TeamSite Add-ons
If you are interested in gaining full access to the content, you can register for a My Support account here.