mirror of
https://github.com/processwire/processwire.git
synced 2025-08-09 16:26:59 +02:00
Fix issue processwire/processwire-issues#1670 plus minor optimizations to template importing
This commit is contained in:
@@ -759,7 +759,7 @@ class Template extends WireData implements Saveable, Exportable {
|
||||
$fieldgroup = $this->wire()->fieldgroups->get($value);
|
||||
if($fieldgroup) {
|
||||
$this->setFieldgroup($fieldgroup);
|
||||
} else {
|
||||
} else if($this->id) {
|
||||
$this->error("Unable to load fieldgroup '$value' for template $this->name");
|
||||
}
|
||||
return;
|
||||
|
@@ -573,6 +573,7 @@ class Templates extends WireSaveableItems {
|
||||
if($template->fieldgroup) $fieldgroupData = $template->fieldgroup->getExportData();
|
||||
$data['fieldgroupFields'] = $fieldgroupData['fields'];
|
||||
$data['fieldgroupContexts'] = $fieldgroupData['contexts'];
|
||||
unset($data['_lazy'], $data['_exportMode']);
|
||||
|
||||
$template->set('_exportMode', false);
|
||||
return $data;
|
||||
|
Reference in New Issue
Block a user