From ed0f5734324e24bc32799fc484de88e9518bb900 Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Wed, 15 Apr 2020 16:28:48 -0400 Subject: [PATCH] Fix issue processwire/processwire-issues#1144 --- wire/modules/PagePathHistory.module | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wire/modules/PagePathHistory.module b/wire/modules/PagePathHistory.module index 6332d66e..2795496f 100644 --- a/wire/modules/PagePathHistory.module +++ b/wire/modules/PagePathHistory.module @@ -164,7 +164,11 @@ class PagePathHistory extends WireData implements Module, ConfigurableModule { $database = $this->wire('database'); $table = self::dbTableName; $path = $this->wire('sanitizer')->pagePathName('/' . trim($path, '/'), Sanitizer::toAscii); - if($this->wire('pages')->count("path=$path")) return false; + + $selector = "path=$path"; + if($this->wire('modules')->isInstalled('PagePaths')) $selector .= ", id!=$page->id"; + if($this->wire('pages')->count($selector)) return false; + $language = $this->getLanguage($language); $sql = "INSERT INTO $table SET path=:path, pages_id=:pages_id, created=NOW()";