1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-11 09:14:58 +02:00

Detect NullPage in InputfieldCKEditor::getImagesFieldName() to fix issue that appeared for someone when editing page with no images fields.

This commit is contained in:
Ryan Cramer
2017-12-31 11:02:42 -05:00
parent a31d4a84e2
commit 9bdad6fc86

View File

@@ -222,7 +222,7 @@ class InputfieldCKEditor extends InputfieldTextarea {
if(!is_array($imageFields)) $imageFields = array();
if(in_array('x', $imageFields)) return '';
$page = $this->hasPage;
if(!$page) return '';
if(!$page || !$page->id || !$page->template) return '';
$result = '';
foreach($imageFields as $name) {
if($page->template->hasField($name)) {