cgoIT / contao-calendar-ical-bundle

Contao extension calendar_ical
Other
0 stars 4 forks source link

Default values werden nicht korrekt festgelegt #14

Closed pointout closed 1 year ago

pointout commented 1 year ago

Ich bekomme eine Fehlermeldung, beim Import aus einer ics-Datei. Ich dachte erst es kommt vor Registrierungserweiterung. Ich habe auch noch eigene Felder für Kalenderevents. Außerdem fehlt mir im DB Statement der Eventtitel aus der ical Datei. Bitte schauen auf: https://github.com/inspiredminds/contao-event-registration/issues/16

Contao 4.9.40 cgoit/contao-calendar-ical-php8-bundle 4.4.9

cgoIT commented 1 year ago

Hi, leider fehlen mir da ein paar Informationen, um den Fehler nachvollziehen zu können.

fritzmg commented 1 year ago

@cgoIT just add a nullable integer field:

// contao/tl_calendar_events.php
$GLOBALS['TL_DCA']['tl_calendar_events']['fields']['foobar'] = [
    'sql' => ['type' => 'integer', 'unsigned' => true, 'notnull' => false],
];

Then import any calendar.

Currently CalendarImport sets the default value to '' (if it wasn't determined otherwise) - which will of course be wrong for integer fields.

What you should do instead is not fill all tl_calendar_events fields with a default value when importing a new record. Or only for those that define the default value in their DCA (by that I do not mean the default value of the SQL definition!). For all other fields the default value is defined by their SQL definition and thus will be automatically filled when you insert a new record.

cgoIT commented 1 year ago

Hi @pointout,

ich habe mal eine fix gepushed. Könntest du bitte mal testen, ob das mit der Version dev-master funktioniert? Wenn ja, dann würde ich eine neue Version zur Verfügung stellen.

pointout commented 1 year ago

Ja, das funktioniert jetzt! Danke!