Ergebnis 1 bis 8 von 8

Thema: 3.5.33 Use of undefined constant self

  1. #1
    Contao-Fan Avatar von syncgw
    Registriert seit
    17.07.2012.
    Beiträge
    313

    Standard 3.5.33 Use of undefined constant self

    PHP Version 7.2.2:

    Code:
    Warning: Use of undefined constant self - assumed 'self' (this will throw an Error in a future version of PHP) in system\modules\_autoload\NamespaceClassLoader.php on line 86
    
    #0 system\modules\_autoload\NamespaceClassLoader.php(86): __error(2, 'Use of undefine...', '\\syst...', 86, Array)
    #1 system\modules\_autoload\NamespaceClassLoader.php(74): NamespaceClassLoader::addContaoRoot(Array)
    #2 system\modules\notification_center\config\autoload.php(26): NamespaceClassLoader::addClassMap(Array)
    #3 system\modules\core\library\Contao\ClassLoader.php(222): include('\\syst...')
    #4 system\initialize.php(105): Contao\ClassLoader::scanAndRegister()
    #5 contao\main.php(16): require('\\syst...')
    #6 {main}
    Jemand eine Idee?
    __________________________________________
    Live long and prosper
    Florian

    Spenden GitHub

  2. #2
    Contao-Fan Avatar von syncgw
    Registriert seit
    17.07.2012.
    Beiträge
    313

    HTML

    NameSpaceClassLoader.php:86
    Code:
    return array_map(array('self', 'addContaoRoot'), $path);
    erledischt...
    __________________________________________
    Live long and prosper
    Florian

    Spenden GitHub

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

    Standard

    Die namespaceclassloader Extension ist nicht vollständig mit PHP 7.2 kompatibel wie es aussieht.

  4. #4
    Contao-Nutzer Avatar von snarosy
    Registriert seit
    27.04.2012.
    Beiträge
    144

    Standard

    Habe hier jetzt offensichtlich dasselbe problem:
    Code:
    PHP Warning: Use of undefined constant self - assumed 'self' (this will throw an Error in a future version of PHP) in ...................../system/modules/_autoload/NamespaceClassLoader.php on line 86
    #0 ................................./system/modules/_autoload/NamespaceClassLoader.php(86): __error(2, 'Use of undefine...', '/var/www/vhosts...', 86, Array)
    #1 ................................./system/modules/_autoload/NamespaceClassLoader.php(74): NamespaceClassLoader::addContaoRoot(Array)
    #2 ................................./system/cache/config/autoload.php(1242): NamespaceClassLoader::addClassMap(Array)
    #3 ................................./system/modules/core/library/Contao/ClassLoader.php(212): include('/var/www/vhosts...')
    #4 ................................./system/initialize.php(105): Contao\ClassLoader::scanAndRegister()
    #5 ................................./index.php(16): require('/var/www/vhosts...')
    #6 {main}
    Ich habe den vorgeschlagenen bugfix mit
    Code:
    return array_map(array('self', 'addContaoRoot'), $path);
    in NameSpaceClassLoader.php:86 durchgeführt,
    leider ohne Erfolg.

    verwendete Versionen
    Contao-Version: 3.5.40
    NamespaceClassLoader: 1.0.3

    Das problem kommt beim Absenden eines Formulars.
    Hat offensichtlich mit dem PHP-Update des Providers auf 7.2 zu tun.

    Gibt es noch weitere Möglichkeiten, dieses Problem zu lösen, außer ein Update auf Contao 4?

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

    Standard

    Welche Extensions hast du installiert, die den NamespaceClassLoader benötigen?

  6. #6
    Contao-Nutzer Avatar von snarosy
    Registriert seit
    27.04.2012.
    Beiträge
    144

    Standard

    Ich habe die Erweiterung notification_center laufen, welche in weiterer Folge darauf zugreift.
    Prinzipiell habe ich alle installierten Erweiterungen auf den letzten Stand gebracht.

    Wobei ich eben im log-File gesehen habe, dass sich der Fehler verlagert hat:
    Code:
    PHP Warning: Declaration of FormRecipient::processFormData($arrSubmitted, $arrLabels) should be compatible with Contao\Form::processFormData($arrSubmitted, $arrLabels, $arrFields) in .............../system/modules/formrecipient/FormRecipient.php on line 12
    #0 .............../system/modules/formrecipient/FormRecipient.php(12): __error(2, 'Declaration of ...', '/var/www/vhosts...', 12, Array)
    #1 .............../system/modules/core/library/Contao/ClassLoader.php(148): include('/var/www/vhosts...')
    #2 [internal function]: Contao\ClassLoader::load('FormRecipient')
    #3 [internal function]: spl_autoload_call('FormRecipient')
    #4 .............../system/modules/core/library/Contao/Controller.php(473): class_exists('FormRecipient')
    #5 .............../system/modules/core/modules/ModuleArticle.php(213): Contao\Controller::getContentElement(Object(Contao\ContentModel), 'main')
    #6 .............../system/modules/core/modules/Module.php(287): Contao\ModuleArticle->compile()
    #7 .............../system/modules/core/modules/ModuleArticle.php(67): Contao\Module->generate()
    #8 .............../system/modules/core/library/Contao/Controller.php(417): Contao\ModuleArticle->generate(false)
    #9 .............../system/modules/core/library/Contao/Controller.php(277): Contao\Controller::getArticle(Object(Contao\ArticleModel), false, false, 'main')
    #10 .............../system/modules/core/pages/PageRegular.php(133): Contao\Controller::getFrontendModule('0', 'main')
    #11 .............../system/modules/core/controllers/FrontendIndex.php(285): Contao\PageRegular->generate(Object(Contao\PageModel), true)
    #12 .............../index.php(20): Contao\FrontendIndex->run()
    #13 {main}
    
     PHP Fatal error: Uncaught exception 'ArgumentCountError' with message 'Too few arguments to function Contao\Form::processFormData(), 2 passed in .............../system/modules/formrecipient/FormRecipient.php on line 23 and exactly 3 expected' thrown in .............../system/modules/core/forms/Form.php on line 297
    #0 .............../system/modules/formrecipient/FormRecipient.php(23): Contao\Form->processFormData(Array, Array)
    #1 .............../system/modules/core/forms/Form.php(249): FormRecipient->processFormData(Array, Array, Array)
    #2 .............../system/modules/core/classes/Hybrid.php(239): Contao\Form->compile()
    #3 .............../system/modules/core/forms/Form.php(84): Contao\Hybrid->generate()
    #4 .............../system/modules/core/library/Contao/Controller.php(484): Contao\Form->generate()
    #5 .............../system/modules/core/modules/ModuleArticle.php(213): Contao\Controller::getContentElement(Object(Contao\ContentModel), 'main')
    #6 .............../system/modules/core/modules/Module.php(287): Contao\ModuleArticle->compile()
    #7 .............../system/modules/core/modules/ModuleArticle.php(67): Contao\Module->generate()
    #8 .............../system/modules/core/library/Contao/Controller.php(417): Contao\ModuleArticle->generate(false)
    #9 .............../system/modules/core/library/Contao/Controller.php(277): Contao\Controller::getArticle(Object(Contao\ArticleModel), false, false, 'main')
    #10 .............../system/modules/core/pages/PageRegular.php(133): Contao\Controller::getFrontendModule('0', 'main')
    #11 .............../system/modules/core/controllers/FrontendIndex.php(285): Contao\PageRegular->generate(Object(Contao\PageModel), true)
    #12 .............../index.php(20): Contao\FrontendIndex->run()
    #13 {main}
    formrecipient habe ich die aktuelle Version 1.2.0 laufen.
    Ich habe keine besonderen Einstellungen beim Formular-Versand, einfach Rohdatenversand per E-Mail.
    Der Versand hat auch schon funktioniert, seit dem letzten Update hatte ich auch eine Änderungen an der Seite durchgeführt...

  7. #7
    Contao-Nutzer Avatar von snarosy
    Registriert seit
    27.04.2012.
    Beiträge
    144

    Standard

    ok, problem gelöst.
    ich hatte schon mal dieses problem im Zusammenspiel mit EFG, wobei ich dieses hier gar nicht laufen habe.
    Manueller Bug-Fix laut https://community.contao.org/de/show...-Fehlermeldung
    Code:
    protected function processFormData($arrSubmitted, $arrLabels, $arrFields) // , $arrFields ergänzt
        {
            $this->recipient = $this->replaceInsertTags(str_replace(array_map(create_function('$a', 'return "{{form::$a}}";'), array_keys($arrSubmitted)), array_values($arrSubmitted), $this->recipient));
            
            return parent::processFormData($arrSubmitted, $arrLabels, $arrFields); // , $arrFields ergänzt
        }
    hat geholfen.

  8. #8
    Contao-Urgestein Avatar von Samson1964
    Registriert seit
    05.11.2012.
    Ort
    Berlin
    Beiträge
    2.794

    Standard

    Habe die eingangs erwähnte Fehlermeldung in einer Contao 4.7.7 mit einigen alten 3er Erweiterungen. Tritt aber erst auf, wenn ich von PHP 7.1 auf PHP 7.3 umstelle (7.2 habe ich nicht getestet). Der Contao Manager stoppt bei diesem Fehler und will ständig reparieren (was nicht funktioniert) oder den sicheren Modus.

    Ich habe nach "NamespaceClassLoader" in system/modules gesucht und außer in _autoload nichts gefunden. Ich habe das Verzeichnis _autoload deshalb gelöscht. Bisher läuft alles einwandfrei und der Contao Manager zickt auch nicht mehr rum.
    Viele Grüße
    Frank

    Seit Mai 2013 Fan von Contao
    Webmaster vom Deutschen Schachbund und Berliner Schachverband
    Mein Blog: Schachbulle
    Meine Erweiterungen bei GitHub
    Meine Videos auf YouTube: Playlist zur Contao-Programmierung/Einrichtung

Aktive Benutzer

Aktive Benutzer

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

Lesezeichen

Lesezeichen

Berechtigungen

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