From c81566db7e3575b6a35f109ff781a9f83c73c15e Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Tue, 3 Dec 2019 09:57:36 -0500 Subject: [PATCH] Fix issue processwire/processwire-issues#1040 --- .../InputfieldPageAutocomplete.module | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wire/modules/Inputfield/InputfieldPageAutocomplete/InputfieldPageAutocomplete.module b/wire/modules/Inputfield/InputfieldPageAutocomplete/InputfieldPageAutocomplete.module index ff0acf57..d6172a1f 100644 --- a/wire/modules/Inputfield/InputfieldPageAutocomplete/InputfieldPageAutocomplete.module +++ b/wire/modules/Inputfield/InputfieldPageAutocomplete/InputfieldPageAutocomplete.module @@ -284,6 +284,7 @@ _OUT; */ protected function getAjaxUrl() { + $pipe = '%7C'; // encoded pipe "|" $selector = $this->findPagesSelector; if($this->parent_id) { @@ -297,7 +298,7 @@ _OUT; } if(count($this->template_ids)) { - $selector .= ",templates_id=" . implode('|', $this->template_ids); + $selector .= ",templates_id=" . implode($pipe, $this->template_ids); } else if($this->template_id) { $selector .= ",templates_id={$this->template_id}"; } @@ -332,6 +333,9 @@ _OUT; $selector .= "&format_name=$name"; } $selector .= "&get=" . $this->labelFieldName; + + // replace any pipes with encoded version + if(strpos($selector, '|') !== false) $selector = str_replace('|', $pipe, $selector); return $this->config->urls->admin . "page/search/for?" . $selector; }