Skip to content

Commit

Permalink
Datensatz klonen: `Calling getId() on new, non-existing datasets is n…
Browse files Browse the repository at this point in the history
…ot allowed, check existence before by $dataset->exists()` beheben (#1517)

/cc @iriswerner
  • Loading branch information
alxndr-w authored Sep 7, 2024
1 parent ed3a91b commit df79eff
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/yform/value/uuid.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ class rex_yform_value_uuid extends rex_yform_value_abstract
{
public function preValidateAction(): void
{
if ('' != $this->getValue()) {
if(rex_get('func', 'string') == "clone") {
// Beim Klonen eine neue UUID generieren
$this->setValue(self::guidv4());
} elseif ('' != $this->getValue()) {
// wenn Wert vorhanden ist direkt zurück
} elseif (isset($this->params['sql_object']) && '' != $this->params['sql_object']->getValue($this->getName())) {
// sql object vorhanden und Wert gesetzt ?
Expand Down

0 comments on commit df79eff

Please sign in to comment.