From 286bf50c3444b39c5c34a82c415eb81d3a18ea0f Mon Sep 17 00:00:00 2001 From: Marc Jauvin Date: Tue, 17 Oct 2023 21:34:57 -0400 Subject: [PATCH] use default values --- modules/backend/formwidgets/RelationManager.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/modules/backend/formwidgets/RelationManager.php b/modules/backend/formwidgets/RelationManager.php index 0c886d9862..577f500170 100644 --- a/modules/backend/formwidgets/RelationManager.php +++ b/modules/backend/formwidgets/RelationManager.php @@ -12,27 +12,27 @@ class RelationManager extends FormWidgetBase /** * @inheritDoc */ - protected string $defaultAlias = 'relationmanager'; + protected $defaultAlias = 'relationmanager'; /** * Disables the ability to add, update, delete or create relations. */ - protected bool $readOnly; + protected bool $readOnly = false; /** * Path to controller action to open a record. */ - protected string $recordUrl; + protected string $recordUrl = ''; /** * Custom JavaScript code to execute when clicking on a record. */ - protected string $recordOnClick; + protected string $recordOnClick = ''; /** * Relation name if different from the field name. */ - protected string $relation; + protected string $relation = ''; public function init(): void { @@ -62,7 +62,8 @@ public function render() 'readOnly' => $this->readOnly, 'recordUrl' => $this->recordUrl, ]; - if (isset($this->recordOnClick)) { + + if ($this->recordOnClick) { $options['recordOnClick'] = $this->recordOnClick; }