mirror of
https://github.com/getgrav/grav.git
synced 2026-07-01 10:59:09 +02:00
Fixed FlexForm serialization
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
* Fixed broken `environment://` stream when it doesn't have configuration
|
||||
* Fixed `Flex Object` missing key field value when using `FolderStorage`
|
||||
* Fixed broken Twig try tag when catch has not been defined or is empty
|
||||
* Fixed `FlexForm` serialization
|
||||
|
||||
# v1.7.18
|
||||
## 07/19/2021
|
||||
|
||||
@@ -103,7 +103,14 @@ class FlexForm implements FlexObjectFormInterface, JsonSerializable
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->setObject($object);
|
||||
$this->setName($object->getFlexType(), $name);
|
||||
|
||||
if (isset($options['form']['name'])) {
|
||||
// Use custom form name.
|
||||
$this->flexName = $options['form']['name'];
|
||||
} else {
|
||||
// Use standard form name.
|
||||
$this->setName($object->getFlexType(), $name);
|
||||
}
|
||||
$this->setId($this->getName());
|
||||
|
||||
$uniqueId = $options['unique_id'] ?? null;
|
||||
@@ -536,7 +543,11 @@ class FlexForm implements FlexObjectFormInterface, JsonSerializable
|
||||
protected function doSerialize(): array
|
||||
{
|
||||
return $this->doTraitSerialize() + [
|
||||
'items' => $this->items,
|
||||
'form' => $this->form,
|
||||
'object' => $this->object,
|
||||
'flexName' => $this->flexName,
|
||||
'submitMethod' => $this->submitMethod,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -548,7 +559,11 @@ class FlexForm implements FlexObjectFormInterface, JsonSerializable
|
||||
{
|
||||
$this->doTraitUnserialize($data);
|
||||
|
||||
$this->object = $data['object'];
|
||||
$this->items = $data['items'] ?? null;
|
||||
$this->form = $data['form'] ?? null;
|
||||
$this->object = $data['object'] ?? null;
|
||||
$this->flexName = $data['flexName'] ?? null;
|
||||
$this->submitMethod = $data['submitMethod'] ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user