parent
7b8f17e6d1
commit
8eafcaa090
|
|
@ -1509,15 +1509,24 @@ class RelationController extends ControllerBehavior
|
||||||
$field = $this->field;
|
$field = $this->field;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$config || !isset($this->originalConfig->{$field})) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
!is_array($config) &&
|
||||||
|
(!$config = @json_decode(@base64_decode($config), true))
|
||||||
|
) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$parsedConfig = array_only($config, ['readOnly']);
|
$parsedConfig = array_only($config, ['readOnly']);
|
||||||
$parsedConfig['view'] = array_only($config, ['recordUrl']);
|
$parsedConfig['view'] = array_only($config, ['recordUrl']);
|
||||||
|
|
||||||
if (is_array($config) && isset($this->originalConfig->{$field})) {
|
$this->originalConfig->{$field} = array_replace_recursive(
|
||||||
$this->originalConfig->{$field} = array_merge_recursive(
|
$this->originalConfig->{$field},
|
||||||
$this->originalConfig->{$field},
|
$parsedConfig
|
||||||
$parsedConfig
|
);
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<div
|
<div
|
||||||
id="<?= $this->relationGetId() ?>"
|
id="<?= $this->relationGetId() ?>"
|
||||||
data-request-data="_relation_field: '<?= $relationField ?>', _relation_extra_config: <?= e(json_encode($relationExtraConfig)) ?>"
|
data-request-data="_relation_field: '<?= $relationField ?>', _relation_extra_config: '<?= e(base64_encode(json_encode($relationExtraConfig))) ?>'"
|
||||||
class="relation-behavior relation-view-<?= $relationViewMode ?>">
|
class="relation-behavior relation-view-<?= $relationViewMode ?>">
|
||||||
|
|
||||||
<?php if ($toolbar = $this->relationRenderToolbar()): ?>
|
<?php if ($toolbar = $this->relationRenderToolbar()): ?>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue