Skip to content

DB-Fehler (Internal Server Error) beim anlegen einer neuen API-Anwendung #8

Description

@srhinow

In bestimmten Mysql/MariaDB -Umgebungen kommt es zu folgenden Fehler:

An exception occurred while executing 'UPDATE tl_api_app SET dateAdded=1559678310 WHERE id='2' AND dateAdded = 0': SQLSTATE[22007]: Invalid datetime format: 1292 Truncated incorrect DOUBLE value: ''

Wenn ich mit der contao-api-bundle Erweiterung eine "Anwendung" anlegen möchte und diese durch reload, save etc. durch den
'onsubmit_callback' => [ ['huh.utils.dca', 'setDateAdded'], ],

läuft es zu den Fehler kommt. Das liegt daran das das Feld dateAddet als varchar(64) default '' deklariert ist es in der Datei "/vendor/heimrichhannot/contao-utils-bundle/src/Dca/DcaUtil.php"
in Zeile 260 auf 0 statt auf '' prüft.

richtig wäre also folgende Zeile 260: $this->framework->createInstance(Database::class)->prepare("UPDATE $dc->table SET dateAdded=? WHERE id=? AND dateAdded = ''")->execute(time(), $dc->id);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions