From fd34d8759538ea66ae3016431bfd75bcd7ec53e4 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Fri, 6 Apr 2018 09:10:11 +0200 Subject: [PATCH 1/2] add entry for 5.1.8 --- CHANGELOG | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 7215814ab..f5c903ed3 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,8 @@ +-------------------------------------------------------------------------------- + Changes in version 5.1.8 +-------------------------------------------------------------------------------- +- fix javascript errors when an error page was shown + -------------------------------------------------------------------------------- Changes in version 5.1.7 -------------------------------------------------------------------------------- From 305a980e44813e2d5c6e61b61a157802d31ee722 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Fri, 6 Apr 2018 09:27:58 +0200 Subject: [PATCH 2/2] ??? --- views/bootstrap/class.Bootstrap.php | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/views/bootstrap/class.Bootstrap.php b/views/bootstrap/class.Bootstrap.php index 2b2ec5d91..2289526ea 100644 --- a/views/bootstrap/class.Bootstrap.php +++ b/views/bootstrap/class.Bootstrap.php @@ -1351,10 +1351,30 @@ $(document).ready(function() { echo "\n"; } /* }}} */ - function exitError($pagetitle, $error, $noexit=false) { /* {{{ */ - $this->htmlStartPage($pagetitle); - $this->globalNavigation(); - $this->contentStart(); + function exitError($pagetitle, $error, $noexit=false, $plain=false) { /* {{{ */ + + /* This is just a hack to prevent creation of js files in an error + * case, because they will contain this error page again. It would be much + * better, if there was extra error() function similar to show() and calling + * $view() after setting the action to 'error'. This would also allow to + * set separate error pages for each view. + */ + if(!$noexit) { + if(in_array($_REQUEST['action'], array('js', 'footerjs'))) { + exit; + } + + if($_REQUEST['action'] == 'webrootjs') { + $this->webrootjs(); + exit; + } + } + + if(!$plain) { + $this->htmlStartPage($pagetitle); + $this->globalNavigation(); + $this->contentStart(); + } print "
"; print "

".getMLText('error')."!

";