From 6b88a8915a95b29217b66bd4721cccf411d5b348 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Fri, 30 Oct 2009 10:13:48 -0700 Subject: [PATCH] Fix bad CSS link in the Edit Survey template. Fixes bug #10984. Update test to scan for links and srcs in the template body, too. --- docs/changelog/7.x.x.txt | 1 + ...ot_import_survey_default-survey-edit.wgpkg | Bin 0 -> 2025 bytes t/rawHrefUrls.t | 43 +++++++++++------- 3 files changed, 28 insertions(+), 16 deletions(-) create mode 100644 docs/upgrades/packages-7.8.3/root_import_survey_default-survey-edit.wgpkg diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index cc3308049..e523f5150 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -28,6 +28,7 @@ - fixed #11179: user.CanStartThread missing from help - fixed #11183: Calendar List View - fixed #11135: Tree Navigation menu template shows a drop down fly-out menu + - fixed #10984: Edit Survey Screen isn't right in demo 7.8.2 - Added scheduled vendor payout workflow activity. (Special thanks to Martin @ Oqapi) diff --git a/docs/upgrades/packages-7.8.3/root_import_survey_default-survey-edit.wgpkg b/docs/upgrades/packages-7.8.3/root_import_survey_default-survey-edit.wgpkg new file mode 100644 index 0000000000000000000000000000000000000000..bc776e75f71d3ceda3a5bac821ed560db614e39d GIT binary patch literal 2025 zcmVe?1)q|YQgrX%&R;?(`xX#T@;z?t>X<9cP zh=fJN6u<(Y6!r4&T>vBjT`X0yG}8yuGa|(W&MtNrz#ho8o$X(HdwcD6YiCE@51RU3 zZ^GRxuf3gmz0qzQ)DId5`#WB}zSlU|@u180uS`h9!L*Pigx=n*FB6!HyTxj7aOuJ6 z`+}zbCy}?ihphUrf)*S zU*EtatVlda6D099k`jgS08=R{UdQ|G_s3c;B;%-$-B&4RDdv)3-B80Qqy!21;%myd z#L=-9(JV2&r<)74{tMe{ruRrCE`72lF4yuyy6U+ zh}R^FFx58HZI?c0S$Z11P&$=&>kTU_0;~ny7(8}#Mb+}#9bk#PSj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the user's config file. - -#note "International macro name = $international"; ##Regexp setup for parsing out the Macro calls. my $macro = qr{ @@ -43,19 +38,28 @@ my $macro = qr{ $numTests = $session->db->quickScalar('select count(distinct(assetId)) from template'); -plan tests => $numTests; +plan tests => 2*$numTests; my $validLinks = 0; +my $nonRootLink = qr{ + ^ + \s* #Optional whitespace + (?: \^ (?: / | Extras)) #Gateway or Extras macro + | # OR + {href}) { - if ($attrs->{href} !~ /\s*\^(?:\/|Extras)/) { + diag sprintf '%s: %s', $tag, $attrs->{href}; + if ($attrs->{href} !~ $nonRootLink) { $validLinks = 0; } } elsif ($tag eq 'script' && $attrs->{src}) { - if ($attrs->{src} !~ /\s*\^(?:\/|Extras)/) { + if ($attrs->{src} !~ $nonRootLink) { $validLinks = 0; } } @@ -70,15 +74,22 @@ my $parser = HTML::Parser->new( my $getATemplate = WebGUI::Asset::Template->getIsa($session); TEMPLATE: while (my $templateAsset = $getATemplate->()) { - my $template = $templateAsset->get('template'); my $header = $templateAsset->get('extraHeadTags'); if(! $header) { - ok(1, sprintf "%s: %s (%s) has no rooted link urls", $templateAsset->getTitle, $templateAsset->getId, $templateAsset->getUrl); - next TEMPLATE; + ok(1, sprintf "%s: %s (%s) has no rooted link urls in the head tags", $templateAsset->getTitle, $templateAsset->getId, $templateAsset->getUrl); + } + else { + $validLinks = 1; + $parser->parse($header); + ok($validLinks, sprintf "%s: %s (%s) has no rooted link urls in the head tags", $templateAsset->getTitle, $templateAsset->getId, $templateAsset->getUrl); + } + my $template = $templateAsset->get('template'); + if(! $template) { + ok(1, sprintf "%s: %s (%s) has no rooted link urls in the template", $templateAsset->getTitle, $templateAsset->getId, $templateAsset->getUrl); + } + else { + $validLinks = 1; + $parser->parse($template); + ok($validLinks, sprintf "%s: %s (%s) has no rooted link urls in the template", $templateAsset->getTitle, $templateAsset->getId, $templateAsset->getUrl); } - $validLinks = 1; - $parser->parse($header); - ok($validLinks, sprintf "%s: %s (%s) has no rooted link urls", $templateAsset->getTitle, $templateAsset->getId, $templateAsset->getUrl); } - -