1
0
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:
Ryan Cramer
2023-01-26 09:55:19 -05:00
parent 2ebb0055be
commit 47f1e8a089
3 changed files with 101 additions and 53 deletions

View File

@@ -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;

View File

@@ -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;