From 270bd13f55a8e181d756bb142c5abf85f3c08057 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 21 Oct 2017 14:52:58 +0200 Subject: [PATCH] FIX Error when adding a bookmark after using an external GET bookmark --- htdocs/bookmarks/bookmarks.lib.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/htdocs/bookmarks/bookmarks.lib.php b/htdocs/bookmarks/bookmarks.lib.php index eca126697cc..5224acd1e70 100644 --- a/htdocs/bookmarks/bookmarks.lib.php +++ b/htdocs/bookmarks/bookmarks.lib.php @@ -115,6 +115,7 @@ function printBookmarksList($aDb, $aLangs) $(document).ready(function () {'; $ret.=' jQuery("#boxbookmark").change(function() { var urlselected = jQuery("#boxbookmark option:selected").attr("rel"); + if (! urlselected) console.log("Error, failed to get the URL to jump to from the rel attribute"); var urltarget = jQuery("#boxbookmark option:selected").attr("target"); if (! urltarget) { urltarget=""; } jQuery("form#actionbookmark").attr("target",urltarget); @@ -126,11 +127,16 @@ function printBookmarksList($aDb, $aLangs) if (urlselected.startsWith(\'http\')) { var newmethod=\'GET\'; - jQuery("form#actionbookmark").attr("method",newmethod); + jQuery("form#actionbookmark").attr("method", newmethod); console.log("We change method to newmethod="+newmethod); - } - - jQuery("#actionbookmark").submit(); + jQuery("#actionbookmark").submit(); + console.log("We restore method to POST"); + jQuery("form#actionbookmark").attr("method", \'POST\'); + } + else + { + jQuery("#actionbookmark").submit(); + } });'; $ret.='})'; $ret .= '';