1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-12 09:44:38 +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(!is_array($imageFields)) $imageFields = array();
if(in_array('x', $imageFields)) return ''; if(in_array('x', $imageFields)) return '';
$page = $this->hasPage; $page = $this->hasPage;
if(!$page) return ''; if(!$page || !$page->id || !$page->template) return '';
$result = ''; $result = '';
foreach($imageFields as $name) { foreach($imageFields as $name) {
if($page->template->hasField($name)) { if($page->template->hasField($name)) {