From 3348f3f13a51411a3f31cb54476a7116990569dd Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Thu, 22 Jun 2017 07:03:28 -0400 Subject: [PATCH] Fix issue processwire/processwire-issues#286 --- wire/core/MarkupQA.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/wire/core/MarkupQA.php b/wire/core/MarkupQA.php index c851ac83..e5572dc7 100644 --- a/wire/core/MarkupQA.php +++ b/wire/core/MarkupQA.php @@ -73,7 +73,10 @@ class MarkupQA extends Wire { if($page) $this->setPage($page); if($field) $this->setField($field); $this->assetsURL = $this->wire('config')->urls->assets; - $this->debug = (bool) $this->wire('config')->debugMarkupQA && $this->wire('user')->isSuperuser(); + if($this->wire('config')->debugMarkupQA) { + $user = $this->wire('user'); + if($user) $this->debug = $user->isSuperuser(); + } } /** @@ -436,6 +439,10 @@ class MarkupQA extends Wire { $langName = $this->debug && $language ? $language->name : ''; if($livePath) { + if($path && substr($path, -1) != '/') { + // no trailing slash, retain the editors wishes here + $livePath = rtrim($livePath, '/'); + } if(strpos($livePath, '/trash/') !== false) { // linked page is in trash, we won't update it but we'll produce a warning $this->linkWarning("$path => $livePath (" . $this->_('it is in the trash') . ')');