Ergebnis 1 bis 14 von 14

Thema: Fehler im Backend - DCA-Fehler: The arguments array must contain 1 items, 0 given

  1. #1
    Contao-Nutzer
    Registriert seit
    03.03.2010.
    Ort
    82194 Gröbenzell
    Beiträge
    201

    Standard Fehler im Backend - DCA-Fehler: The arguments array must contain 1 items, 0 given

    Hallo,

    ich habe einen Fork von https://github.com/cliffparnitzky/BirthdayMailer erstellt, um das nach 5.3 zu portieren. Das Ganze ist im Moment nur auf github unter: https://github.com/arminfrey/contao-gbm-bundle

    DCA tl_geburtstagsmail:
    #
    PHP-Code:
    <?php

    use Contao\Backend;
    use 
    Contao\DataContainer;
    use 
    Contao\DC_Table;
    use 
    Contao\Image;
    use 
    Contao\Input;

    $GLOBALS['TL_DCA']['tl_geburtstagsmail'] = array(
        
    // Config
        
    'config' => array(
            
    'dataContainer'            => DC_Table::class,
            
    'enableVersioning'        => true,
            
    'sql' => array(
                
    'keys' => array(
                    
    'id' => 'primary'
                
    )
            )
        ),    
        
    // List
        
    'list' => array(
            
    'sorting' => array(
                
    'mode'        => DataContainer::MODE_SORTABLE,
                        
    'fields'      => array('id'),
                        
    'panelLayout' => 'filter;sort,search,limit'
            
    )
        ),    
        
    'label' => array(
            
    'fields'        => array('memberGroup:tl_member_group.name''priority'),
            
    'label_callback'    => array('tl_geburtstagsmail''addIcon'),
            
    'showColumns'        => true 
        
    ),    
        
    'global_operations' => array(
            
    'sendBirthdayMail' => array(
                
    'label'               => &$GLOBALS['TL_LANG']['tl_geburtstagsmail']['sendBirthdayMail'],
                
    'href'                => 'key=sendBirthdayMail',
                
    'attributes'          => 'onclick="Backend.getScrollOffset();" style="background: url(src//assets/sendBirthdayMail.png) no-repeat scroll left center transparent; margin-left: 15px; padding: 2px 0 3px 20px;"'
            
    ),
            
    'all' => array(
                
    'label'               => &$GLOBALS['TL_LANG']['MSC']['all'],
                
    'href'                => 'act=select',
                
    'class'               => 'header_edit_all',
                
    'attributes'          => 'onclick="Backend.getScrollOffset();"'
            
    )
        ),    
        
    'operations' => array(
            
    'edit' => array(
                
    'label'               => &$GLOBALS['TL_LANG']['tl_geburtstagsmail']['edit'],
                
    'href'                => 'act=edit',
                
    'icon'                => 'edit.svg'
            
    ),
            
    'copy' => array(
                
    'label'               => &$GLOBALS['TL_LANG']['tl_geburtstagsmail']['copy'],
                
    'href'                => 'act=copy',
                
    'icon'                => 'copy.svg'
            
    ),
            
    'delete' => array(
                
    'label'               => &$GLOBALS['TL_LANG']['tl_geburtstagsmail']['delete'],
                
    'href'                => 'act=delete',
                
    'icon'                => 'delete.svg',
                
    'attributes'          => 'onclick="if (!confirm(\'' $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\')) return false; Backend.getScrollOffset()"'
            
    ),
            
    'show' => array(
                
    'label'            => &$GLOBALS['TL_LANG']['tl_geburtstagsmail']['show'],
                
    'href'            => 'act=show',
                
    'icon'            => 'show.svg',
                
    'attributes'        => 'style="margin-right:3px"'
            
    )
        ),
          
    // Palettes
        
    'palettes' => array(
            
    '__selector__' => array('mailUseCustomText'),
            
    'default'      => '{config_legend},memberGroup,priority;{email_legend},sender,senderName,mailCopy,mailBlindCopy,mailUseCustomText'
        
    ),
        
    // Subpalettes
        
    'subpalettes' => array('mailUseCustomText' => 'mailTextKey'),
        
    // Fields
        
    'fields'      => array(
            
    'id'             => array(
                
    'sql' => "int(10) unsigned NOT NULL auto_increment"
            
    ),
            
    'tstamp'         => array(
                
    'sql' => "int(10) unsigned NOT NULL default '0'"
            
    ),
        
    'memberGroup' => array(
            
    'label'            => &$GLOBALS['TL_LANG']['tl_geburtstagsmail']['memberGroup'],
            
    'exclude'        => true,
            
    'inputType'        => 'select',
            
    'foreignKey'        => 'tl_member_group.name',
            
    'filter'        => true,
            
    'eval'            => array('mandatory'=>true'unique'=>true'includeBlankOption'=>true'tl_class'=>'w50'),
            
    'sql'            => "int(10) unsigned NOT NULL default '0'",
            
    //'relation'           => ['type' => 'belongsTo', 'load' => 'lazy']
        
    ),
        
    'priority' => array(
            
    'label'            => &$GLOBALS['TL_LANG']['tl_geburtstagsmail']['priority'],
            
    'exclude'        => true,
            
    'inputType'        => 'text',
            
    'eval'            => array('rgxp' => 'digit','maxlength'=>10'tl_class'=>'w50'),
            
    'sql'            => "int(10) unsigned NOT NULL default '0'"
        
    ),
        
    'sender' => array(
            
    'label'            => &$GLOBALS['TL_LANG']['tl_geburtstagsmail']['sender'],
            
    'exclude'        => true,
            
    'inputType'        => 'text',
            
    'eval'            => array('mandatory'=>true'rgxp' => 'email','maxlength'=>128'tl_class'=>'w50'),
            
    'sql'            => "varchar(128) NOT NULL default '0'"
        
    ),
        
    'senderName' => array(
            
    'label'        => &$GLOBALS['TL_LANG']['tl_geburtstagsmail']['senderName'],
            
    'exclude'    => true,
            
    'inputType'    => 'text',
            
    'eval'        => array('rgxp' => 'extnd','maxlength'=>128'tl_class'=>'w50'),
            
    'sql'        => "varchar(128) NOT NULL default '0'"
        
    ),
        
    'mailCopy' => array(
            
    'label'        => &$GLOBALS['TL_LANG']['tl_geburtstagsmail']['mailCopy'],
            
    'exclude'    => true,
            
    'inputType'    => 'text',
            
    'eval'        => array('rgxp' => 'emails','maxlength'=>255'tl_class'=>'w50'),
            
    'sql'        => "varchar(255) NOT NULL default '0'"
        
    ),
        
    'mailBlindCopy' => array(
            
    'label'        => &$GLOBALS['TL_LANG']['tl_geburtstagsmail']['mailBlindCopy'],
            
    'exclude'    => true,
            
    'inputType'    => 'text',
            
    'eval'        => array('rgxp' => 'emails','maxlength'=>255'tl_class'=>'w50'),
            
    'sql'        => "varchar(255) NOT NULL default '0'"
        
    ),
        
    'mailUseCustomText' => array(
            
    'label'        => &$GLOBALS['TL_LANG']['tl_geburtstagsmail']['mailUseCustomText'],
            
    'exclude'    => true,
            
    'inputType'    => 'checkbox',
            
    'eval'        => array('tl_class'=>'w50''submitOnChange'=>true),
            
    'sql'        => "char(1) NOT NULL default '0'"
        
    ),
        
    'mailTextKey' => array(
            
    'label'        => &$GLOBALS['TL_LANG']['tl_geburtstagsmail']['mailTextKey'],
            
    'exclude'    => true,
            
    'inputType'    => 'text',
            
    'eval'        => array('mandatory'=>true'maxlength'=>20'spaceToUnderscore'=>true'tl_class'=>'w50'),
            
    'sql'        => "varchar(20) NOT NULL default '0'"
        
    )
        )
    );


    class 
    tl_geburtstagsmail extends Backend
    {
        public function 
    addIcon($row$label)
        {
            
    var_dump("addicon");
            if (empty(
    $row)) {
                    \
    Contao\Log::add('Row data is empty for icon generation.''ContaoGbmBundle addIcon()'TL_ERROR);
            }
                
    // Check that row has necessary keys
                
    if (!isset($row['memberGroup'], $row['start'], $row['stop'], $row['disable'])) {
                    return 
    $label// Or handle appropriately
                
    }

                
    $image 'mgroup';
                
    $disabled = ($row['start'] !== '' && $row['start'] > time()) || ($row['stop'] !== '' && $row['stop'] <= time());

                if (
    $disabled || $row['disable']) {
                
    $image .= '--disabled';
                }

                return 
    sprintf('<div class="list_icon" style="background-image:url(\'%s\')" data-icon="%s" data-icon-disabled="%s">%s</div>',
                
    Image::getUrl($image),
                
    Image::getUrl($image),
                
    Image::getUrl($image '--disabled'),
                
    $label
                
    );
        }
    }
    Beim Erstellen einer neuen Konfiguration für automatische Mails, bekomme ich den Fehler : The arguments array must contain 1 items, 0 given

    Er legt noch eine ID auf der Datenbank an beim Anzeigen des Fehlers. Ich komme leider nicht weiter.

    Stacktrace:
    Code:
     Symfony Exception
     Symfony Docs
    ErrorException
    HTTP 500 Internal Server Error
    Warning: Trying to access array offset on null
    ErrorException
    ErrorException:
    Warning: Trying to access array offset on null
    
      at vendor/contao/core-bundle/contao/classes/DataContainer.php:1669
      at Contao\DataContainer->generateRecordLabel()
         (vendor/contao/core-bundle/src/EventListener/DataContainer/FallbackRecordLabelListener.php:57)
      at Contao\CoreBundle\EventListener\DataContainer\FallbackRecordLabelListener->__invoke()
         (vendor/symfony/event-dispatcher/Debug/WrappedListener.php:116)
      at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke()
         (vendor/symfony/event-dispatcher/EventDispatcher.php:220)
      at Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
         (vendor/symfony/event-dispatcher/EventDispatcher.php:56)
      at Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
         (vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:139)
      at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch()
         (vendor/contao/core-bundle/src/DataContainer/RecordLabeler.php:28)
      at Contao\CoreBundle\DataContainer\RecordLabeler->getLabel()
         (vendor/contao/core-bundle/src/DataContainer/DcaUrlAnalyzer.php:111)
      at Contao\CoreBundle\DataContainer\DcaUrlAnalyzer->getTrail()
         (vendor/contao/core-bundle/contao/classes/Backend.php:410)
      at Contao\Backend->getBackendModule()
         (vendor/contao/core-bundle/contao/controllers/BackendMain.php:144)
      at Contao\BackendMain->run()
         (vendor/contao/core-bundle/src/Controller/BackendController.php:44)
      at Contao\CoreBundle\Controller\BackendController->mainAction()
         (vendor/symfony/http-kernel/HttpKernel.php:181)
      at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
         (vendor/symfony/http-kernel/HttpKernel.php:76)
      at Symfony\Component\HttpKernel\HttpKernel->handle()
         (vendor/symfony/http-kernel/Kernel.php:197)
      at Symfony\Component\HttpKernel\Kernel->handle()
         (public/index.php:42)
    Contao 5.3.21, PHP 8.3.15

    Ich weiß, es ist im DCA versteckt, ich habe aber alles durchgeschaut. Fehlt die memberGroup, weil er die Tabelle nicht findet? Leider kann ich dazwischen kein var_dump() oder print_f() schreiben.

    Eilt nicht, aber es wäre schön, wenn mir jemand helfen könnte.

    Vielen Dank.

    Grüße Armin

  2. #2
    Alter Contao-Hase
    Registriert seit
    24.02.2021.
    Beiträge
    1.477
    Partner-ID
    11715
    Contao-Projekt unterstützen

    Support Contao

    Standard

    https://github.com/contao/contao/pull/7860

    Wird bald in der 5.3.22 behoben - Du kannst einen conflict auf 5.3.21 eintragen und hast den Fehler dann nicht.

  3. #3
    Contao-Nutzer
    Registriert seit
    03.03.2010.
    Ort
    82194 Gröbenzell
    Beiträge
    201

    Standard

    Hallo,

    danke, aber das ist es nicht. Ich habe einen Conflict eingetragen, Fehler trit auch in der 5.3.20, 5.3.19, 5.3.18 auf. Weiter zurück bin ich nicht gegangen.
    Ich habe dann wie im verlinkten PR in FallbackRecordLabelListener.php die beiden Zeilen ergänzt:

    Code:
    core-bundle/src/EventListener/DataContainer/FallbackRecordLabelListener.php
    
     $dc = (new \ReflectionClass(DC_Table::class))->newInstanceWithoutConstructor();
            $dc->table = $table;
            $dc->id = (int) $id;
    Der Fehler kommt aus contao/core-bundle/contao/classes/DataContainer.php
    in der Funktion:

    Code:
    public function generateRecordLabel(array $row, string|null $table = null, bool $protected = false, bool $isVisibleRootTrailPage = false)
    	{
    		$table = $table ?? $this->strTable;
    		$labelConfig = &$GLOBALS['TL_DCA'][$table]['list']['label'];
    		$args = array();
    
    		foreach ($labelConfig['fields'] as $k=>$v)
    		{
    			if (str_contains($v, ':'))
    			{
    				list($strKey, $strTable) = explode(':', $v, 2);
    				list($strTable, $strField) = explode('.', $strTable, 2); ...
    $table ist gefüllt, $labelConfig ist null

  4. #4
    Community-Moderator
    Wandelndes Contao-Lexikon
    Avatar von Spooky
    Registriert seit
    12.04.2012.
    Ort
    Scotland
    Beiträge
    37.161
    Partner-ID
    10107

    Standard

    Zitat Zitat von armin41 Beitrag anzeigen
    Hallo,

    danke, aber das ist es nicht. Ich habe einen Conflict eingetragen, Fehler trit auch in der 5.3.20, 5.3.19, 5.3.18 auf. Weiter zurück bin ich nicht gegangen.
    Welcher Fehler denn nun genau? Der ursprüngliche Fehler, den du gepostet hast, ist definitv ein Fehler in Contao 5.3.21. Wenn du jetzt auf Contao 5.3.20 downgegraded hast, ist es vermutlich ein anderer. Poste den Stack Trace davon.
    » sponsor me via GitHub or Revolut

  5. #5
    Contao-Nutzer
    Registriert seit
    03.03.2010.
    Ort
    82194 Gröbenzell
    Beiträge
    201

    Standard

    Ich habe den Conflict wieder entfernt und habe die Version 5.3.21: StackTrace:
    Code:
    ErrorException:
    Warning: Trying to access array offset on null
    
      at vendor/contao/core-bundle/contao/classes/DataContainer.php:1669
      at Contao\DataContainer->generateRecordLabel()
         (vendor/contao/core-bundle/contao/drivers/DC_Table.php:5384)
      at Contao\DC_Table->listView()
         (vendor/contao/core-bundle/contao/drivers/DC_Table.php:468)
      at Contao\DC_Table->showAll()
         (vendor/contao/core-bundle/contao/classes/Backend.php:462)
      at Contao\Backend->getBackendModule()
         (vendor/contao/core-bundle/contao/controllers/BackendMain.php:144)
      at Contao\BackendMain->run()
         (vendor/contao/core-bundle/src/Controller/BackendController.php:44)
      at Contao\CoreBundle\Controller\BackendController->mainAction()
         (vendor/symfony/http-kernel/HttpKernel.php:181)
      at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
         (vendor/symfony/http-kernel/HttpKernel.php:76)
      at Symfony\Component\HttpKernel\HttpKernel->handle()
         (vendor/symfony/http-kernel/Kernel.php:197)
      at Symfony\Component\HttpKernel\Kernel->handle()
         (public/index.php:42)

  6. #6
    Community-Moderator
    Wandelndes Contao-Lexikon
    Avatar von Spooky
    Registriert seit
    12.04.2012.
    Ort
    Scotland
    Beiträge
    37.161
    Partner-ID
    10107

    Standard

    Du musst den conflict hinzufügen, dann eine vollständige Paketaktualisierung posten, dann den Fehler reproduzieren und den Stack Trace posten.
    » sponsor me via GitHub or Revolut

  7. #7
    Contao-Nutzer
    Registriert seit
    03.03.2010.
    Ort
    82194 Gröbenzell
    Beiträge
    201

    Standard

    Conflict auf 5.3.21 eingetragen, alle Pakete aktualisiert:

    Code:
    > Resolving dependencies using Composer Cloud v3.8.1
    
    [7.6MiB/0.18s] Loading composer repositories with package information
    [8.2MiB/1.55s] [8.2MiB/1.72s] [8.4MiB/3.48s] [8.4MiB/3.48s] [99.2MiB/15.61s] Updating dependencies
    [33.5MiB/17.36s] Lock file operations: 0 installs, 1 update, 0 removals
    [33.5MiB/17.36s]   - Upgrading arminfrey/contao-gbm-bundle (1.2.6 => 1.2.7)
    [32.6MiB/17.38s] Writing lock file
    [18.6MiB/17.41s] Package php-http/message-factory is abandoned, you should avoid using it. Use psr/http-factory instead.
    [18.9MiB/17.78s] No security vulnerability advisories found.
    [19.4MiB/17.78s] Memory usage: 19.45MB (peak: 231.49MB), time: 17.78s.
    [19.4MiB/17.78s] Finished Composer Cloud resolving.
    
    
    # Job ID zOqlROigRTPeC8LYGSgrOBvvAYXX2NqrL0Ief9wIUBk7EZQiKi9ZHi6lErU1lS5L635qGAZiESlPIovaB completed in 12 seconds
    # Memory usage: 19.45MB (peak: 231.49MB), time: 17.78s.
    
    $ /opt/plesk/php/8.3/bin/php -q -dmax_execution_time=0 -dmemory_limit=-1 -ddisplay_errors=0 -ddisplay_startup_errors=0 -derror_reporting=0 -dallow_url_fopen=1 -ddisable_functions= -ddate.timezone=Europe/Berlin /var/www/vhosts/krettenweiber.de/httpdocs/intern/public/contao-manager.phar.php composer install --no-dev --no-progress --no-ansi --no-interaction --optimize-autoloader
    
    Installing dependencies from lock file
    Verifying lock file contents can be installed on current platform.
    Package operations: 0 installs, 1 update, 0 removals
      - Downloading arminfrey/contao-gbm-bundle (1.2.7)
      - Upgrading arminfrey/contao-gbm-bundle (1.2.6 => 1.2.7): Extracting archive
    Package php-http/message-factory is abandoned, you should avoid using it. Use psr/http-factory instead.
    Generating optimized autoload files
    contao/manager-plugin: Dumping generated plugins file...
    contao/manager-plugin: ...done dumping generated plugins file
    130 packages you are using are looking for funding.
    Use the `composer fund` command to find out more!
    > @php vendor/bin/contao-setup
    Added the bin/console file.
    Added the public/preview.php file.
    Added the public/index.php file.
    
     Trying to install assets as relative symbolic links.
    
     --- --------------------------------------------- ------------------ 
          Bundle                                        Method / Error    
     --- --------------------------------------------- ------------------ 
      ?   ContaoCoreBundle                              relative symlink  
      ?   RockSolidCustomElementsBundle                 relative symlink  
      ?   MarkocupicExportTable                         relative symlink  
      ?   MultiColumnWizardBundle                       relative symlink  
      ?   ContaoFaqBundle                               relative symlink  
      ?   CodefogHasteBundle                            relative symlink  
      ?   Terminal42DcawizardBundle                     relative symlink  
      ?   ArminfreyContaoJugendBundle                   relative symlink  
      ?   HeimrichHannotContaoMultiColumnEditorBundle   relative symlink  
      ?   SrhinowSimpleMapBundle                        relative symlink  
      ?   ContaoNewsBundle                              relative symlink  
      ?   Terminal42ConditionalSelectMenuBundle         relative symlink  
      ?   Terminal42LeadsBundle                         relative symlink  
      ?   RockSolidFrontendHelperBundle                 relative symlink  
      ?   ContaoMemberExtensionBundle                   relative symlink  
      ?   con4gisCoreBundle                             relative symlink  
      ?   Terminal42NotificationCenterBundle            relative symlink  
      ?   ContaoCalendarBundle                          relative symlink  
      ?   ContaoNewsletterBundle                        relative symlink  
      ?   CgoitContaoCalendarIcalBundle                 relative symlink  
      ?   con4gisMapsBundle                             relative symlink  
      ?   ContaoCommentsBundle                          relative symlink  
     --- --------------------------------------------- ------------------ 
    
     [OK] All assets were successfully installed.                                   
    
    
     --- ---------------------------------------------------- -------------------------------------------------- 
          Symlink                                              Target / Error                                    
     --- ---------------------------------------------------- -------------------------------------------------- 
      !   public/files/layout/fonts/ABeeZee                    Skipped because files/layout will be symlinked.   
      ?   public/files/hometmp                                 files/hometmp                                     
      ?   public/files/bilder                                  files/bilder                                      
      ?   public/files/layout                                  files/layout                                      
      ?   public/files/vorstand                                files/vorstand                                    
      ?   public/files/downloads/Kinderhäser                   files/downloads/Kinderhäser                       
      ?   public/files/downloads/Gruppenordnung                files/downloads/Gruppenordnung                    
      ?   public/files/downloads/Presseberichte                files/downloads/Presseberichte                    
      ?   public/files/downloads/Archiv/ArchivKirbe            files/downloads/Archiv/ArchivKirbe                
      ?   public/files/downloads/Archiv/ArchivGruppenordnung   files/downloads/Archiv/ArchivGruppenordnung       
      ?   public/system/modules/mobile_menu/assets             system/modules/mobile_menu/assets                 
      ?   system/themes/flexible                               vendor/contao/core-bundle/contao/themes/flexible  
      ?   public/assets                                        assets                                            
      ?   public/system/themes                                 system/themes                                     
      ?   system/logs                                          var/logs                                          
      ?   public/vendor/scrivo/highlight_php/styles            vendor/scrivo/highlight.php/styles                
     --- ---------------------------------------------------- -------------------------------------------------- 
    
    
     // Clearing the cache for the prod environment with debug false                
    
     [OK] Cache for the "prod" environment (debug=false) was successfully cleared.  
    
    
     // Clearing the cache for the dev environment with debug true                  
    
     [OK] Cache for the "dev" environment (debug=true) was successfully cleared.    
    
    
     // Warming up the cache for the prod environment with debug false              
    
    string(15) "tl_member_group"
    try
     [OK] Cache for the "prod" environment (debug=false) was successfully warmed.   
    
    
     [INFO] Done! Please run the contao:migrate command to make sure the database is
            up-to-date.                                                             
    
    
    # Process terminated with exit code 0
    # Result: OK
    StackTrace:
    Code:
    ErrorException:
    Warning: Trying to access array offset on null
    
      at vendor/contao/core-bundle/contao/classes/DataContainer.php:1669
      at Contao\DataContainer->generateRecordLabel()
         (vendor/contao/core-bundle/contao/drivers/DC_Table.php:5384)
      at Contao\DC_Table->listView()
         (vendor/contao/core-bundle/contao/drivers/DC_Table.php:468)
      at Contao\DC_Table->showAll()
         (vendor/contao/core-bundle/contao/classes/Backend.php:462)
      at Contao\Backend->getBackendModule()
         (vendor/contao/core-bundle/contao/controllers/BackendMain.php:144)
      at Contao\BackendMain->run()
         (vendor/contao/core-bundle/src/Controller/BackendController.php:44)
      at Contao\CoreBundle\Controller\BackendController->mainAction()
         (vendor/symfony/http-kernel/HttpKernel.php:181)
      at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
         (vendor/symfony/http-kernel/HttpKernel.php:76)
      at Symfony\Component\HttpKernel\HttpKernel->handle()
         (vendor/symfony/http-kernel/Kernel.php:197)
      at Symfony\Component\HttpKernel\Kernel->handle()
         (public/index.php:42)
    Keine Veränderung

  8. #8
    Community-Moderator
    Wandelndes Contao-Lexikon
    Avatar von Spooky
    Registriert seit
    12.04.2012.
    Ort
    Scotland
    Beiträge
    37.161
    Partner-ID
    10107

    Standard

    Deine 'label' Sektion in deinem DCA ist unter der falschen Sektion. Die gehört zu 'list'.

    Laut deiner Konsolenausgabe wurde übrigens nicht auf Contao 5.3.20 downgegraded. Auf welcher Contao Version bist du nun? Wie sieht deine composer.json nun aus?
    » sponsor me via GitHub or Revolut

  9. #9
    Contao-Nutzer
    Registriert seit
    03.03.2010.
    Ort
    82194 Gröbenzell
    Beiträge
    201

    Standard

    Ich bin auf 5.3.21, meine composer.json:
    Code:
    {
        "type": "project",
        "require": {
            "arminfrey/contao-jugend-bundle": "^2.0",
    		"arminfrey/contao-gbm-bundle": "^1.0",
            "cgoit/contao-calendar-ical-bundle": "^5.3",
            "codefog/contao-mobile_menu": "^2.7",
            "con4gis/maps": "^9.0",
            "contao/calendar-bundle": "5.3.*",
            "contao/comments-bundle": "5.3.*",
            "contao/conflicts": "*@dev",
            "contao/faq-bundle": "5.3.*",
            "contao/listing-bundle": "5.3.*",
            "contao/manager-bundle": "5.3.*",
            "contao/news-bundle": "5.3.*",
            "contao/newsletter-bundle": "5.3.*",
            "heimrichhannot/contao-multi-column-editor-bundle": "^2.20",
            "madeyourday/contao-rocksolid-custom-elements": "^2.4",
            "madeyourday/contao-rocksolid-frontend-helper": "^2.2",
            "markocupic/export_table": "^5.6",
            "oveleon/contao-member-extension-bundle": "^1.6",
            "srhinow/simple-map-bundle": "^5.0",
            "terminal42/contao-conditionalselectmenu": "^4.2",
            "terminal42/contao-leads": "^3.0",
            "terminal42/notification_center": "^2.0",
            "w3scout/contao-timetags-bundle": "^2.0"
        },
        "extra": {
            "public-dir": "public",
            "contao-component-dir": "assets"
        },
        "scripts": {
            "post-install-cmd": [
                "@php vendor/bin/contao-setup"
            ],
            "post-update-cmd": [
                "@php vendor/bin/contao-setup"
            ]
        },
    	"autoload": {
          "psr-4": {
                "App\\": "src/"
           }		
    	},
    	"conflict": {
    		"contao/contao-core": "5.3.21"
    	},
    	"config": {
         "github-oauth": {
           "github.com": "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"
         }
       	},
    	"repositories": [
        	{
          		"type": "vcs",
          		"url": "https://github.com/arminfrey/contao-jugend-bundle"	
        	},
    	 	{
         		"type": "vcs",
    	  		"url": "https://github.com/arminfrey/contao-gbm-bundle"	
        	}
    	]
    }
    Dann ändere ich die DCA.

  10. #10
    Community-Moderator
    Wandelndes Contao-Lexikon
    Avatar von Spooky
    Registriert seit
    12.04.2012.
    Ort
    Scotland
    Beiträge
    37.161
    Partner-ID
    10107

    Standard

    Dein conflict Eintrag ist falsch, der muss so lauten:
    Code:
    "conflict": {
        "contao/core-bundle": "5.3.21"
    }
    Danach eine vollständige Paketaktualisierung durchführen.
    » sponsor me via GitHub or Revolut

  11. #11
    Contao-Nutzer
    Registriert seit
    03.03.2010.
    Ort
    82194 Gröbenzell
    Beiträge
    201

    Standard

    Ja, natürlich. Downgrade auf 5.3.20 wurde durchgeführt, alle Pakete aktualisiert.

    Fehler bleibt gleich, aber liegt ja an der DCA.

  12. #12
    Community-Moderator
    Wandelndes Contao-Lexikon
    Avatar von Spooky
    Registriert seit
    12.04.2012.
    Ort
    Scotland
    Beiträge
    37.161
    Partner-ID
    10107

    Standard

    Zitat Zitat von armin41 Beitrag anzeigen
    Fehler bleibt gleich
    Durch das Downgrade sollte der ursprüngliche Fehler, den du hier im Thread gepostet hast, weg sein. Für den neuen Fehler musst du dein DCA fixen, ja.
    » sponsor me via GitHub or Revolut

  13. #13
    Contao-Nutzer
    Registriert seit
    03.03.2010.
    Ort
    82194 Gröbenzell
    Beiträge
    201

    Standard

    Das war immer der gleiche Fehler, DCA falsch aufgebaut. Nach Bereinigung der DCA keinen Fehler in der 5.3.21 mehr.

    angepasste DCA (label, global_operations, operations gehören in den Array list:

    Code:
    <?php
    
    use Contao\Backend;
    use Contao\DataContainer;
    use Contao\DC_Table;
    use Contao\Image;
    use Contao\Input;
    
    $GLOBALS['TL_DCA']['tl_geburtstagsmail'] = array(
    	// Config
    	'config' => array(
    		'dataContainer'			=> DC_Table::class,
    		'enableVersioning'		=> true,
    		'sql' => array(
    			'keys' => array(
    				'id' => 'primary'
    			)
    		)
    	),	
    	// List
    	'list' => array(
    		'sorting' => array(
    			'mode'        => DataContainer::MODE_SORTABLE,
                		'fields'      => array('id'),
                		'panelLayout' => 'filter;sort,search,limit'
    		),	
    		'label' => array(
    			'fields'		=> array('memberGroup:tl_member_group.name', 'priority'),
    			'label_callback'	=> array('tl_geburtstagsmail', 'addIcon'),
    			'showColumns'		=> true 
    		),	
    		'global_operations' => array(
    			'sendBirthdayMail' => array(
    				'label'               => &$GLOBALS['TL_LANG']['tl_geburtstagsmail']['sendBirthdayMail'],
    				'href'                => 'key=sendBirthdayMail',
    				'attributes'          => 'onclick="Backend.getScrollOffset();" style="background: url(src//assets/sendBirthdayMail.png) no-repeat scroll left center transparent; margin-left: 15px; padding: 2px 0 3px 20px;"'
    			),
    			'all' => array(
    				'label'               => &$GLOBALS['TL_LANG']['MSC']['all'],
    				'href'                => 'act=select',
    				'class'               => 'header_edit_all',
    				'attributes'          => 'onclick="Backend.getScrollOffset();"'
    			)
    		),	
    		'operations' => array(
    			'edit' => array(
    				'label'               => &$GLOBALS['TL_LANG']['tl_geburtstagsmail']['edit'],
    				'href'                => 'act=edit',
    				'icon'                => 'edit.svg'
    			),
    			'copy' => array(
    				'label'               => &$GLOBALS['TL_LANG']['tl_geburtstagsmail']['copy'],
    				'href'                => 'act=copy',
    				'icon'                => 'copy.svg'
    			),
    			'delete' => array(
    				'label'               => &$GLOBALS['TL_LANG']['tl_geburtstagsmail']['delete'],
    				'href'                => 'act=delete',
    				'icon'                => 'delete.svg',
    				'attributes'          => 'onclick="if (!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\')) return false; Backend.getScrollOffset()"'
    			),
    			'show' => array(
    				'label'			=> &$GLOBALS['TL_LANG']['tl_geburtstagsmail']['show'],
    				'href'			=> 'act=show',
    				'icon'			=> 'show.svg',
    				'attributes'		=> 'style="margin-right:3px"'
    			)
    		)
    	),
      	// Palettes
    	'palettes' => array(
    		'__selector__' => array('mailUseCustomText'),
    		'default'      => '{config_legend},memberGroup,priority;{email_legend},sender,senderName,mailCopy,mailBlindCopy,mailUseCustomText'
    	),
    	// Subpalettes
    	'subpalettes' => array('mailUseCustomText' => 'mailTextKey'),
    	// Fields
        'fields'      => array(
            'id'             => array(
                'sql' => "int(10) unsigned NOT NULL auto_increment"
            ),
            'tstamp'         => array(
                'sql' => "int(10) unsigned NOT NULL default '0'"
            ),
    	'memberGroup' => array(
    		'label'			=> &$GLOBALS['TL_LANG']['tl_geburtstagsmail']['memberGroup'],
    		'exclude'		=> true,
    		'inputType'		=> 'select',
    		'foreignKey'		=> 'tl_member_group.name',
    		'filter'		=> true,
    		'eval'			=> array('mandatory'=>true, 'unique'=>true, 'includeBlankOption'=>true, 'tl_class'=>'w50'),
    		'sql'			=> "int(10) unsigned NOT NULL default '0'",
    		//'relation'   		=> ['type' => 'belongsTo', 'load' => 'lazy']
    	),
    	'priority' => array(
    		'label'			=> &$GLOBALS['TL_LANG']['tl_geburtstagsmail']['priority'],
    		'exclude'		=> true,
    		'inputType'		=> 'text',
    		'eval'			=> array('rgxp' => 'digit','maxlength'=>10, 'tl_class'=>'w50'),
    		'sql'			=> "int(10) unsigned NOT NULL default '0'"
    	),
    	'sender' => array(
    		'label'			=> &$GLOBALS['TL_LANG']['tl_geburtstagsmail']['sender'],
    		'exclude'		=> true,
    		'inputType'		=> 'text',
    		'eval'			=> array('mandatory'=>true, 'rgxp' => 'email','maxlength'=>128, 'tl_class'=>'w50'),
    		'sql'			=> "varchar(128) NOT NULL default '0'"
    	),
    	'senderName' => array(
    		'label'		=> &$GLOBALS['TL_LANG']['tl_geburtstagsmail']['senderName'],
    		'exclude'	=> true,
    		'inputType'	=> 'text',
    		'eval'		=> array('rgxp' => 'extnd','maxlength'=>128, 'tl_class'=>'w50'),
    		'sql'		=> "varchar(128) NOT NULL default '0'"
    	),
    	'mailCopy' => array(
    		'label'		=> &$GLOBALS['TL_LANG']['tl_geburtstagsmail']['mailCopy'],
    		'exclude'	=> true,
    		'inputType'	=> 'text',
    		'eval'		=> array('rgxp' => 'emails','maxlength'=>255, 'tl_class'=>'w50'),
    		'sql'		=> "varchar(255) NOT NULL default '0'"
    	),
    	'mailBlindCopy' => array(
    		'label'		=> &$GLOBALS['TL_LANG']['tl_geburtstagsmail']['mailBlindCopy'],
    		'exclude'	=> true,
    		'inputType'	=> 'text',
    		'eval'		=> array('rgxp' => 'emails','maxlength'=>255, 'tl_class'=>'w50'),
    		'sql'		=> "varchar(255) NOT NULL default '0'"
    	),
    	'mailUseCustomText' => array(
    		'label'		=> &$GLOBALS['TL_LANG']['tl_geburtstagsmail']['mailUseCustomText'],
    		'exclude'	=> true,
    		'inputType'	=> 'checkbox',
    		'eval'		=> array('tl_class'=>'w50', 'submitOnChange'=>true),
    		'sql'		=> "char(1) NOT NULL default '0'"
    	),
    	'mailTextKey' => array(
    		'label'		=> &$GLOBALS['TL_LANG']['tl_geburtstagsmail']['mailTextKey'],
    		'exclude'	=> true,
    		'inputType'	=> 'text',
    		'eval'		=> array('mandatory'=>true, 'maxlength'=>20, 'spaceToUnderscore'=>true, 'tl_class'=>'w50'),
    		'sql'		=> "varchar(20) NOT NULL default '0'"
    	)
        )
    );
    
    
    class tl_geburtstagsmail extends Backend
    {
    	public function addIcon($row, $label)
    	{
    		if (empty($row)) {
        			\Contao\Log::add('Row data is empty for icon generation.', 'ContaoGbmBundle addIcon()', TL_ERROR);
    		}
        		// Check that row has necessary keys
        		if (!isset($row['memberGroup'], $row['start'], $row['stop'], $row['disable'])) {
            		return $label; // Or handle appropriately
        		}
    
        		$image = 'mgroup';
        		$disabled = ($row['start'] !== '' && $row['start'] > time()) || ($row['stop'] !== '' && $row['stop'] <= time());
    
        		if ($disabled || $row['disable']) {
    			$image .= '--disabled';
        		}
    
        		return sprintf('<div class="list_icon" style="background-image:url(\'%s\')" data-icon="%s" data-icon-disabled="%s">%s</div>',
            	Image::getUrl($image),
            	Image::getUrl($image),
            	Image::getUrl($image . '--disabled'),
            	$label
        		);
    	}
    }
    Vielen Dank.

  14. #14
    Community-Moderator
    Wandelndes Contao-Lexikon
    Avatar von Spooky
    Registriert seit
    12.04.2012.
    Ort
    Scotland
    Beiträge
    37.161
    Partner-ID
    10107

    Standard

    Du hattest zwei verschiedene Fehler:

    • "The arguments array must contain 1 items, 0 given" - das ist ein Fehler in Contao 5.3.21.
    • "Trying to access array offset on null" - das ist ein Fehler aufgrund deines DCAs, welcher aber nur im Debug Modus auftritt.
    » sponsor me via GitHub or Revolut

Aktive Benutzer

Aktive Benutzer

Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •