From fff501cac3ba431e9e73518e4a6eb51602e70741 Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Tue, 17 Oct 2017 05:33:32 -0400 Subject: [PATCH] Correct an issue in Repeater that interfered with some file-upload situations in draft page versions --- wire/modules/Fieldtype/FieldtypePageTable.module | 5 +++++ .../FieldtypeRepeater/FieldtypeRepeater.module | 13 +++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/wire/modules/Fieldtype/FieldtypePageTable.module b/wire/modules/Fieldtype/FieldtypePageTable.module index 4503abe8..c6c47360 100644 --- a/wire/modules/Fieldtype/FieldtypePageTable.module +++ b/wire/modules/Fieldtype/FieldtypePageTable.module @@ -416,6 +416,11 @@ class FieldtypePageTable extends FieldtypeMulti implements Module { if(count($sorts)) $items->sort($sorts); } + foreach($items as $item) { + $item->setQuietly('_pageTableField', $field->id); + $item->setQuietly('_pageTableParent', $page->id); + } + return $items; } diff --git a/wire/modules/Fieldtype/FieldtypeRepeater/FieldtypeRepeater.module b/wire/modules/Fieldtype/FieldtypeRepeater/FieldtypeRepeater.module index 2d73989a..9ef3e6c5 100644 --- a/wire/modules/Fieldtype/FieldtypeRepeater/FieldtypeRepeater.module +++ b/wire/modules/Fieldtype/FieldtypeRepeater/FieldtypeRepeater.module @@ -111,12 +111,13 @@ class FieldtypeRepeater extends Fieldtype implements ConfigurableModule { if(!$fieldtype || !$fieldtype instanceof FieldtypeRepeater) continue; /** @var FieldtypeRepeater $fieldtype */ $template = $fieldtype->getRepeaterTemplate($field); - if(!$template) continue; - if(__NAMESPACE__) { - $template->setQuietly('pageClass', wireClassName($fieldtype->getPageClass())); - } else { - $template->setQuietly('pageClass', $fieldtype->getPageClass()); - } + if(!$template) continue; + $class = $fieldtype->getPageClass(); + if(__NAMESPACE__ && $class) $class = wireClassName($class); + $_class = $template->get('pageClass'); + if($class === $_class) continue; + $template->set('pageClass', $class); + $template->save(); } if($this->wire('page')->process == 'ProcessPageEdit') {