From 6e7f760d09b0691ae26b4bcaf370d08e09c39917 Mon Sep 17 00:00:00 2001 From: Marcus Nyeholt Date: Mon, 30 May 2016 12:44:26 +1000 Subject: [PATCH] FIX Ignore content generation Requirements calls If an element declares some Requirements during its rendering, these requirements get bound to the ajax request during a 'save' call from the cms, and can then filter through to the CMS UI. This clears out any added during the Content population process --- code/extensions/ElementPageExtension.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/extensions/ElementPageExtension.php b/code/extensions/ElementPageExtension.php index 3b9b4130..54d4a2fe 100644 --- a/code/extensions/ElementPageExtension.php +++ b/code/extensions/ElementPageExtension.php @@ -138,6 +138,7 @@ public function onBeforeWrite() // Copy widgets content to Content to enable search $searchableContent = array(); + Requirements::clear(); foreach ($elements->Elements() as $element) { if ($element->config()->exclude_from_content) { continue; @@ -151,6 +152,7 @@ public function onBeforeWrite() array_push($searchableContent, $controller->WidgetHolder()); } } + Requirements::restore(); $this->owner->Content = trim(implode(' ', $searchableContent)); }