Skip to content

Commit

Permalink
Bugfix beim Speichern mit "Übernehmen" (#144)
Browse files Browse the repository at this point in the history
* Bugfix beim Speichern mit "Übernehmen"

In dem Fall kam es zu einem Fehler `Unable to rollback, no transaction started before` aus dem Manager. Tatsächlich war die Ursache im Geolocation-Value `layerselect` in der Zeile 99: 

`$this->getParam('manager_dataset')->getValue($this->subField);`

Beim "Speichern" existiert `param['manager_dataset']`, beim "Übernehmen" jedoch nicht, was im Hintergrund zu einem `getValue on null`-Fehler führt.

* Update CHANGELOG.md

* Update package.yml

* Update CHANGELOG.md
  • Loading branch information
christophboecker authored May 28, 2023
1 parent 6a9d69c commit a0a253a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# Changelog

## 21.03.2023 2.0.0
## 28.05.2023 2.0.1

- Bugfix:
- Behebt einen Fehler `Unable to rollback, no transaction started before` beim Speichern eines Mapset-Formulars mit "Übernehmen" statt "Speichern" (#144)

## 21.03.2023 2.0.0

- Bugfix:
- Tastatursteuerung in der Baisiskarten-Auswahl der Kartensätze korrigiert. (#139)
Expand All @@ -14,7 +18,6 @@ Beta3:
- Fixed
- Probleme mit der Einbindung der Action-Buttons in YForm 4.1.0 wurden behoben (#130).


Beta2:

- Neu:
Expand Down
10 changes: 9 additions & 1 deletion lib/yform/value/layerselect.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,15 @@ public function preValidateAction(): void
$this->setValue($value);
}
} elseif (0 < $this->params['main_id']) {
$selectedLayers = $this->getParam('manager_dataset')->getValue($this->subField);
// Strange! Verlässt man das Formular über "Speichern" ist der YOrm-Dataset verfügbar.
// Speichert man mit "Übernehmen" fehlt er.
try {
// "Speichern"
$selectedLayers = $this->getParam('manager_dataset')->getValue($this->subField);
} catch (\Throwable $th) {
// "Übernehmen"
$selectedLayers = $this->getParam('sql_object')->getValue($this->subField);
}
} else {
$selectedLayers = [];
$value = [];
Expand Down
2 changes: 1 addition & 1 deletion package.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package: geolocation
version: '2.0.0'
version: '2.0.1'
author: Friends Of REDAXO
supportpage: https://github.com/FriendsOfREDAXO/geolocation

Expand Down

0 comments on commit a0a253a

Please sign in to comment.