Skip to content

Commit

Permalink
init FormControlProperty only if exists
Browse files Browse the repository at this point in the history
  • Loading branch information
nworr committed Dec 14, 2023
1 parent c12c1c0 commit fa4faae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 3 additions & 1 deletion lizmap/modules/lizmap/lib/Form/QgisForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -1356,7 +1356,9 @@ private function fillControlFromValueRelationLayer($fieldName, $formControl)
// if ($this->ctrl->emptyItemLabel !== null || !$this->ctrl->required)
// To add an empty value to ValueRelation displayed as menulist, we only
// have to set an emptyItemLabel !== null
$formControl->ctrl->emptyItemLabel = '';
if (property_exists($formControl->ctrl, 'emptyItemLabel')) {
$formControl->ctrl->emptyItemLabel = '';
}

// Create Datasource
$dataSource = new QgisFormValueRelationDynamicDatasource($formControl->ref);
Expand Down
5 changes: 0 additions & 5 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -412,11 +412,6 @@ parameters:
count: 2
path: lizmap/modules/lizmap/lib/Form/QgisForm.php

-
message: "#^Access to an undefined property jFormsControl\\:\\:\\$emptyItemLabel\\.$#"
count: 1
path: lizmap/modules/lizmap/lib/Form/QgisForm.php

-
message: "#^Access to an undefined property jICoordPlugin\\:\\:\\$config\\.$#"
count: 2
Expand Down

0 comments on commit fa4faae

Please sign in to comment.