Skip to content

Commit

Permalink
use default values
Browse files Browse the repository at this point in the history
  • Loading branch information
mjauvin committed Oct 18, 2023
1 parent 50d5c99 commit 286bf50
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions modules/backend/formwidgets/RelationManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -62,7 +62,8 @@ public function render()
'readOnly' => $this->readOnly,
'recordUrl' => $this->recordUrl,
];
if (isset($this->recordOnClick)) {

if ($this->recordOnClick) {
$options['recordOnClick'] = $this->recordOnClick;
}

Expand Down

0 comments on commit 286bf50

Please sign in to comment.