cgoIT/contao-calendar-ical-bundle

Default values werden nicht korrekt festgelegt

Closed this issue · 4 comments

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: inspiredminds/contao-event-registration#16

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

cgoIT commented

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

  • PHP Version
  • Beispiel einer csv-Datei, bei der das Problem auftritt
  • ggf. weitere Informationen zu den Settings des Kalenders

@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

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.

Ja, das funktioniert jetzt! Danke!