Attempt to read property "cssClassName" on null

  • Betroffene Version
    WoltLab Suite 5.4
    Betroffene App
    WoltLab Suite Filebase

    Hallo, ich habe seit kurzem folgende Fehlermeldungen in der log stehen

    Aufgerufene URL
    POST /index.php?ajax-proxy/&t=0d81af7c67a8276e92a265a12ab8984957b5c9e2f9971e6ed43efe9d1d62ff29-RQLFXur8qtVPPx1vmlxulg==
    Referrer
    https://der-ls-treffpunkt.de/
    WoltLab Suite
    5.4.8
    PHP
    8.0.13
    Fehlermeldung
    Attempt to read property "cssClassName" on null
    Art
    wcf\system\exception\ErrorException
    Datei (Zeile)
    /var/www/vhosts/der-ls-treffpunkt.de/httpdocs/lib/system/WCF.class.php (344)
    Template Context
    <?php } ?> </div> <div> ====> <h3><?=$this->v['notification']['event']->getMessage();?></h3> <small><?=$this->pluginObjects['wcf\system\template\plugin\TimeModifierTemplatePlugin']->execute([$this->v['notification']['time']], $this);?></small> </div> </div> </li> <?php } unset($this->v['notification']);$this->v['notification'] = $this->foreachVars['70061e444ad974f1de6e59f00e53cdc9a6dcecc4']['item'];
    Stacktrace
    1. /var/www/vhosts/der-ls-treffpunkt.de/httpdocs/lib/system/template/TemplateEngine.class.php(626) : eval()'d code (1): wcf\system\WCF::handleError(…)
    2. /var/www/vhosts/der-ls-treffpunkt.de/httpdocs/lib/system/template/TemplateEngine.class.php (626): eval(…)
    3. /var/www/vhosts/der-ls-treffpunkt.de/httpdocs/lib/data/language/Language.class.php (169): wcf\system\template\TemplateEngine->fetchString(…)
    4. /var/www/vhosts/der-ls-treffpunkt.de/httpdocs/filebase/lib/system/user/notification/event/FileModerationUserNotificationEvent.class.php (87): wcf\data\language\Language->getDynamicVariable(…)
    5. /var/www/vhosts/der-ls-treffpunkt.de/httpdocs/templates/compiled/25_wcf_1_notificationListUserPanel.php (39): filebase\system\user\notification\event\FileModerationUserNotificationEvent->getMessage(…)
    6. /var/www/vhosts/der-ls-treffpunkt.de/httpdocs/lib/system/template/TemplateEngine.class.php (346): include(…)
    7. /var/www/vhosts/der-ls-treffpunkt.de/httpdocs/lib/system/template/TemplateEngine.class.php (590): wcf\system\template\TemplateEngine->display(…)
    8. /var/www/vhosts/der-ls-treffpunkt.de/httpdocs/lib/data/user/notification/UserNotificationAction.class.php (202): wcf\system\template\TemplateEngine->fetch(…)
    9. /var/www/vhosts/der-ls-treffpunkt.de/httpdocs/lib/data/AbstractDatabaseObjectAction.class.php (216): wcf\data\user\notification\UserNotificationAction->getOutstandingNotifications(…)
    10. /var/www/vhosts/der-ls-treffpunkt.de/httpdocs/lib/action/AJAXProxyAction.class.php (86): wcf\data\AbstractDatabaseObjectAction->executeAction(…)
    11. /var/www/vhosts/der-ls-treffpunkt.de/httpdocs/lib/action/AJAXInvokeAction.class.php (111): wcf\action\AJAXProxyAction->invoke(…)
    12. /var/www/vhosts/der-ls-treffpunkt.de/httpdocs/lib/action/AbstractAction.class.php (53): wcf\action\AJAXInvokeAction->execute(…)
    13. /var/www/vhosts/der-ls-treffpunkt.de/httpdocs/lib/action/AJAXInvokeAction.class.php (65): wcf\action\AbstractAction->__run(…)
    14. /var/www/vhosts/der-ls-treffpunkt.de/httpdocs/lib/system/request/Request.class.php (89): wcf\action\AJAXInvokeAction->__run(…)
    15. /var/www/vhosts/der-ls-treffpunkt.de/httpdocs/lib/system/request/RequestHandler.class.php (119): wcf\system\request\Request->execute(…)
    16. /var/www/vhosts/der-ls-treffpunkt.de/httpdocs/index.php (11): wcf\system\request\RequestHandler->handle(…)

    Was ich gemacht hatte heute, ist ein vorhandenes Style exportiert, dieses dann wieder Importiert und angepasst umgeschrieben als Winterliches Style. Kann es damit was zu tun haben?


    Website: https://der-ls-treffpunkt.de

    lg Mario 8)

  • Wenn du nur genau das gemacht hast, hat das nichts damit zu tun.

    Ich habe leider keine Lizenz für die Filebase und könnte höchstens in den Code der RC-Version von vor Ewigkeiten schauen, sonst könnte ich dir evtl. mehr sagen.

    Ich tippe aber darauf, dass der Fehler sich auf filebase.file.notification.moderation.setLabel.notification.message bezieht.

    Zumindest damals scheint der Fall, dass ein Label entfernt wird, nicht bedacht, aber PHP-seitig implementiert worden zu sein.

  • Also es liegt an einer Benutzergruppe welche es schon lange gibt (Download Manager) dieser verursacht diesen Fehler wenn er unter "Benachrichtigungen" sich dir neusten Benachrichtigungen ansehen möchte.

    Schau mal hier ist der Fehler (Code:503) ich denke das liegt daran, evtl. Datenbank, Tabelle, Eintrag oder so.

    • Offizieller Beitrag

    Hallo,

    ich konnte das Problem leider nicht reproduzieren und die Fehlermeldung liefert leider keine ausreichenden Informationen über die Ursache - die Fehlermeldung stellt nur ein Symptom dar. Sollte es erneut auftreten, bitten wir um eine Rückmeldung, damit wir dies genauer untersuchen können.

    Interessant sind in diesem Zusammenhang auch kurze Zeit vorher aufgetretene Fehler, da diese möglicherweise die Meldung in diesem Thema verursacht haben.

    Alexander Ebert
    Senior Developer WoltLab® GmbH

  • ich konnte das Problem leider nicht reproduzieren und die Fehlermeldung liefert leider keine ausreichenden Informationen über die Ursache - die Fehlermeldung stellt nur ein Symptom dar. Sollte es erneut auftreten, bitten wir um eine Rückmeldung, damit wir dies genauer untersuchen können.

    Die Sprachvariable nutzt (zumindest in der RC-Version): {if $userNotificationObject->getDecoratedObject()->label->cssClassName}

    FileAction::assignLabel() nutzt beim Entfernen von Labels:

    PHP: FileAction
                foreach ($oldFileLabels as $groupID => $label) {
                    if (isset($newFileLabels[$groupID])) {
                        continue;
                    }
                    FileModificationLogHandler::getInstance()
                        ->setLabel($file->getDecoratedObject(), null, $label);
                }

    Das wiederum führt zu:

    PHP: FileModificationLogHandler
            $this->fireNotification(
                $file,
                $this->add($file, 'setLabel', [
                    'label' => $label,
                    'oldLabel' => $oldLabel,
                ])
            );

    Das wiederum legt via AbstractModificationLogHandler::createLog() einen ModificationLog an, in dessen additionalData der Wert für label null ist, was dann zwangsweise zu obigem Fehler führt, da nicht geprüft wird, ob der Parameter ungleich null ist, sondern stumpf verwendet wird.

    In filebase.file.log.file.setLabel dagegen wird korrekt geprüft. Das Ganze passiert über FileModerationUserNotificationEvent, das wiederum in FileModificationLogHandler::fireNotification() getriggert wird.

    Ob das in der aktuellen Version noch besteht, kann ich nicht sagen; in der RC-Version ist der Bug aber im Code nachvollziehbar. Es fehlt hier entweder eine Prüfung in der Sprachvariable oder man entfernt Moderations-Benachrichtigungen für entfernte Labels komplett.

    So weit meine zwei Minuten Code-Inspektion auf Basis der genannten Fehlermeldung…

  • So das gleiche Problem tritt leider wieder auf bei genau dem gleichem User. Klickt man bei ihm auf der notification-list bekommt man folgende Meldung in der log

    Aufgerufene URL
    POST /index.php?ajax-proxy/&t=9cc6e2543ff2209d8a688f876f501e9b0e44267da54293ea45f84efb58337c6f-WIEdswp1z4rlVkLXDuJYkQ==
    Referrer
    https://der-ls-treffpunkt.de/
    WoltLab Suite
    5.4.10
    PHP
    8.0.14
    Fehlermeldung
    Attempt to read property "cssClassName" on null
    Art
    wcf\system\exception\ErrorException
    Datei (Zeile)
    /var/www/vhosts/der-ls-treffpunkt.de/httpdocs/lib/system/WCF.class.php (344)
    Template Context
    <?php } ?> </div> <div> ====> <h3><?=$this->v['notification']['event']->getMessage();?></h3> <small><?=$this->pluginObjects['wcf\system\template\plugin\TimeModifierTemplatePlugin']->execute([$this->v['notification']['time']], $this);?></small> </div> </div> </li> <?php } unset($this->v['notification']);$this->v['notification'] = $this->foreachVars['03c8b8b83fc8dbd7b529103f9b7725d7622ed532']['item'];
    Stacktrace
    1. /var/www/vhosts/der-ls-treffpunkt.de/httpdocs/lib/system/template/TemplateEngine.class.php(626) : eval()'d code (1): wcf\system\WCF::handleError(…)
    2. /var/www/vhosts/der-ls-treffpunkt.de/httpdocs/lib/system/template/TemplateEngine.class.php (626): eval(…)
    3. /var/www/vhosts/der-ls-treffpunkt.de/httpdocs/lib/data/language/Language.class.php (169): wcf\system\template\TemplateEngine->fetchString(…)
    4. /var/www/vhosts/der-ls-treffpunkt.de/httpdocs/filebase/lib/system/user/notification/event/FileModerationUserNotificationEvent.class.php (87): wcf\data\language\Language->getDynamicVariable(…)
    5. /var/www/vhosts/der-ls-treffpunkt.de/httpdocs/templates/compiled/25_wcf_1_notificationListUserPanel.php (39): filebase\system\user\notification\event\FileModerationUserNotificationEvent->getMessage(…)
    6. /var/www/vhosts/der-ls-treffpunkt.de/httpdocs/lib/system/template/TemplateEngine.class.php (346): include(…)
    7. /var/www/vhosts/der-ls-treffpunkt.de/httpdocs/lib/system/template/TemplateEngine.class.php (590): wcf\system\template\TemplateEngine->display(…)
    8. /var/www/vhosts/der-ls-treffpunkt.de/httpdocs/lib/data/user/notification/UserNotificationAction.class.php (202): wcf\system\template\TemplateEngine->fetch(…)
    9. /var/www/vhosts/der-ls-treffpunkt.de/httpdocs/lib/data/AbstractDatabaseObjectAction.class.php (216): wcf\data\user\notification\UserNotificationAction->getOutstandingNotifications(…)
    10. /var/www/vhosts/der-ls-treffpunkt.de/httpdocs/lib/action/AJAXProxyAction.class.php (86): wcf\data\AbstractDatabaseObjectAction->executeAction(…)
    11. /var/www/vhosts/der-ls-treffpunkt.de/httpdocs/lib/action/AJAXInvokeAction.class.php (111): wcf\action\AJAXProxyAction->invoke(…)
    12. /var/www/vhosts/der-ls-treffpunkt.de/httpdocs/lib/action/AbstractAction.class.php (53): wcf\action\AJAXInvokeAction->execute(…)
    13. /var/www/vhosts/der-ls-treffpunkt.de/httpdocs/lib/action/AJAXInvokeAction.class.php (65): wcf\action\AbstractAction->__run(…)
    14. /var/www/vhosts/der-ls-treffpunkt.de/httpdocs/lib/system/request/Request.class.php (89): wcf\action\AJAXInvokeAction->__run(…)
    15. /var/www/vhosts/der-ls-treffpunkt.de/httpdocs/lib/system/request/RequestHandler.class.php (119): wcf\system\request\Request->execute(…)
    16. /var/www/vhosts/der-ls-treffpunkt.de/httpdocs/index.php (11): wcf\system\request\RequestHandler->handle(…)

    Es muss ja irgendeine Ursache haben weshalb das plötzlich so ist.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!