[Rt-commit] rt branch, 5.0/fix-queue-header-in-approval-display, created. rt-5.0.0-188-gb99feb4647

? sunnavy sunnavy at bestpractical.com
Thu Dec 31 10:06:44 EST 2020


The branch, 5.0/fix-queue-header-in-approval-display has been created
        at  b99feb46478069c58cfbf9af60d817ccb5497dc1 (commit)

- Log -----------------------------------------------------------------
commit b8bb88821b314f2607d21bae9a313d91c70f61c4
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Dec 31 22:13:08 2020 +0800

    Switch to div to not create illegal nested links
    
    The first inner link here is the Queue name in ticket summary. Nested
    links are illegal, and browsers handle them weirdly that breaks UI. E.g.
    they could insert outer <a>(without content) to its descendants till the
    inner <a>.
    
    Note that "name" attribute is invalid in both <a> and <div>, here we
    switch to "id" and tweak the value, which also fixes #txn-ID anchors on
    the same page.
    
    Fixes: I#37013

diff --git a/share/html/Approvals/Elements/ShowDependency b/share/html/Approvals/Elements/ShowDependency
index 60c219b1a9..f8297e013a 100644
--- a/share/html/Approvals/Elements/ShowDependency
+++ b/share/html/Approvals/Elements/ShowDependency
@@ -54,7 +54,7 @@
 my %show;
 while (my $link = $approving->Next()) {
     next unless ($link->BaseURI->IsLocal());
-    my $text = '<a name="' . $link->BaseObj->Id . '">';
+    my $text = '<div id="txn-' . $link->BaseObj->Id . '">';
     my $head = '';
     my $type = $link->BaseObj->Type;
     my $dep  = $m->scomp('ShowDependency', Ticket => $link->BaseObj, _seen => $_seen);
@@ -77,7 +77,7 @@ while (my $link = $approving->Next()) {
     $head .= $m->scomp('/Widgets/TitleBoxEnd');
     $text .= $m->scomp('/Widgets/TitleBoxEnd');
     $text .= $dep;
-    $text .= '</a>';
+    $text .= '</div>';
     $show{$link->BaseObj->Id} = {
         text => $text,
         head => $head,

commit b99feb46478069c58cfbf9af60d817ccb5497dc1
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Dec 31 22:42:18 2020 +0800

    Fix uninitialized warnings for empty nested dependency

diff --git a/share/html/Approvals/Elements/ShowDependency b/share/html/Approvals/Elements/ShowDependency
index f8297e013a..efd2fd3885 100644
--- a/share/html/Approvals/Elements/ShowDependency
+++ b/share/html/Approvals/Elements/ShowDependency
@@ -57,7 +57,7 @@ while (my $link = $approving->Next()) {
     my $text = '<div id="txn-' . $link->BaseObj->Id . '">';
     my $head = '';
     my $type = $link->BaseObj->Type;
-    my $dep  = $m->scomp('ShowDependency', Ticket => $link->BaseObj, _seen => $_seen);
+    my $dep  = $m->scomp('ShowDependency', Ticket => $link->BaseObj, _seen => $_seen) // '';
 
     if ($type eq 'approval') {
         $head .= $m->scomp('/Widgets/TitleBoxStart', title => loc("Approval #[_1]: [_2]", $link->BaseObj->Id, $link->BaseObj->Subject));

-----------------------------------------------------------------------


More information about the rt-commit mailing list