Skip to content

Fehler im Frontend und Backend bei Einbindung in Contao 4.13 #28

@franklytom

Description

@franklytom

Context
Contao version: 4.13
Bundle version: 2.18
PHP version: 8.2

Description
Getestet auf einer aktuellen Contao Installation mit der Beispielwebsite.
tl_member wird erweitert um ein Feld children mit folgender Konfiguration.

`<?php

use Contao\CoreBundle\DataContainer\PaletteManipulator;

$GLOBALS['TL_DCA']['tl_member']['fields']['children'] = [
'inputType' => 'multiColumnEditor',
'exclude' => true,
'eval' => [
'multiColumnEditor' => [
'sortable' => true,
'minRowCount' => 1,
'maxRowCount' => 8,
'isFrontend' => true,
'isBackend' => true,
'fields' => [
'firstname' => [
'label' => 'Vorname',
'inputType' => 'text',
'eval' => ['groupStyle' => 'width:150px', 'submitOnChange' => true]
],
'lastname' => [
'label' => 'Nachname',
'inputType' => 'text',
'eval' => ['groupStyle' => 'width:150px']
],
'birthdate' => [
'label' => 'Geburtsdatum',
'inputType' => 'text',
'eval' => ['rgxp'=>'date', 'datepicker'=>true, 'mandatory'=>true, 'tl_class'=>'wizard']
]
]
],
'feEditable'=>true, 'feViewable'=>true, 'feGroup'=>'children'
],
'sql' => "blob NULL"
];

PaletteManipulator::create()
->addLegend('children_legend', 'invisible_legend', PaletteManipulator::POSITION_AFTER)
->addField('children', 'children_legend', PaletteManipulator::POSITION_APPEND)
->applyToPalette('default', 'tl_member') ;
`

Grundsätzlich funktioniert das Verhalten im Backend mit folgenden Auffälligkeiten:

  • Das Icon des Wizards wird nicht dahinter gesetzt sondern darunter.
  • Es werden Hilfstexte eingebunden, die aus dem zweiten Buchstaben des Labels bestehen.
    Gibt es hier eine Doku dazu, wie man die Labels und Hilfstexte richtig in den xlf-Dateien hinterlegt?
Bildschirmfoto 2024-02-22 um 09 18 52

Das Frontend jedoch funktioniert nicht:
Dazu erstelle ich ein Registrierungsmodul und wähle das Feld children aus.

Bildschirmfoto 2024-02-22 um 09 22 27

Im FE wird das Feld dann angezeigt, aber:

  1. Ein JavaScript-Error weißt auf ein Problem mit Sortable hin:
    Uncaught (in promise) TypeError: t.create is not a function
    at contao-multi-column-editor-bundle.js?v=6f2e73b4:1:9505
    at NodeList.forEach ()
    at contao-multi-column-editor-bundle.js?v=6f2e73b4:1:9482

  2. Klick auf Add produziert folgenden JS-Error:
    POST https://www-local.contao.de/?as=ajax&ag=_mce&aa=addRow 400 (Bad Request)

  3. Klick auf Sort bleibt ohne Reaktion.

Was mache ich falsch? 👯
Bildschirmfoto 2024-02-22 um 09 25 25

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions