diff --git a/VERSIONS_HOTLINE/179242 b/VERSIONS_HOTLINE/179242 new file mode 100644 index 0000000000000000000000000000000000000000..2d212f8944bc619c490b0f1a51b36d2327a5afd4 --- /dev/null +++ b/VERSIONS_HOTLINE/179242 @@ -0,0 +1 @@ + - correctif #179242 : OPAC [MT] : La suppression d'une notice d'une sélection n'entraine plus d'affichage de fenêtre intempestive \ No newline at end of file diff --git a/library/templates/Intonation/Library/Selection.php b/library/templates/Intonation/Library/Selection.php index 92ade1565bcf384407c105f88722c3d23444fa72..6665cb40318d195b637cdbc3eec7d0af92582d8c 100644 --- a/library/templates/Intonation/Library/Selection.php +++ b/library/templates/Intonation/Library/Selection.php @@ -91,8 +91,8 @@ class Intonation_Library_Selection { $url = Class_Url::relative($this->_getUrlForContext()); $js = - sprintf("event.preventDefault(); event.stopPropagation(); var url = $(this).attr('href'); var anchors = $('a[href=\'' + url + '\']'); $.ajax({type: 'GET', url: '%s', success: function(data) {anchors.replaceWith(data.anchor);}});", - $url); + sprintf("event.preventDefault(); event.stopPropagation(); var url = $(this).attr('href'); var anchors = $('a[href=\'' + url + '\']'); $.ajax({type: 'GET', url: '%s', success: function(data) {if (data){return anchors.replaceWith(data.anchor);} return false;}});", + $url); return (new Intonation_Library_Link) ->setUrl($url) diff --git a/tests/scenarios/Templates/MyBibAppTemplateTest.php b/tests/scenarios/Templates/MyBibAppTemplateTest.php index f5489723dfc1baf4e06ec7ee53fad6d974ed0b01..e4600cfac2b5a6651a242ab309434363b3ca944a 100644 --- a/tests/scenarios/Templates/MyBibAppTemplateTest.php +++ b/tests/scenarios/Templates/MyBibAppTemplateTest.php @@ -816,7 +816,7 @@ class MyBibAppTemplateActionsCardTest extends ViewHelperTestCase { * @depends addToReadedShouldBeDisplayInRow */ public function addToReadedShouldContainsScript() { - $js = 'event.preventDefault(); event.stopPropagation(); var url = $(this).attr(\'href\'); var anchors = $(\'a[href=\\\'\' + url + \'\\\']\'); $.ajax({type: \'GET\', url: \'/abonne/ajouter-le-document-a-la-selection/selection_label/D%C3%A9j%C3%A0+lu/image/readed/revert-image/unread/record_id/213/ajax/\', success: function(data) {anchors.replaceWith(data.anchor);}});'; + $js = 'event.preventDefault(); event.stopPropagation(); var url = $(this).attr(\'href\'); var anchors = $(\'a[href=\\\'\' + url + \'\\\']\'); $.ajax({type: \'GET\', url: \'/abonne/ajouter-le-document-a-la-selection/selection_label/D%C3%A9j%C3%A0+lu/image/readed/revert-image/unread/record_id/213/ajax/\', success: function(data) {if (data){return anchors.replaceWith(data.anchor);} return false;}});'; $this->assertXPath(static::$_set_up->html, '//a[contains(@onclick, "'. $js .'")]');