Nachtrag und Korrektur zu
Antwort #4So wie es aussieht habe ich mich mit diesem Codevorschlag etwas vertan.
$this->title = "MODULE_ORDER_TOTAL_SUBTOTAL_TITLE";
Jetzt habe ich mir die Datei admin/module.php etwas genauer angeschaut und dabei festgestellt das es verschiedene Ursachen gibt die zu der längeren Lieste von E_WARNINGs diese Art
[15-01-2019 14:04:29] E_WARNING : LoggingManager: Use of undefined constant MODULE_ORDER_TOTAL_SUBTOTAL_TITLE - assumed 'MODULE_ORDER_TOTAL_SUBTOTAL_TITLE' (this will throw an Error in a future version of PHP) in File: /home/www/2042/includes/modules/order_total/ot_subtotal.php on Line: 24
so wie sie wagners in
Antwort #2 gepostet hat führt. Zum einen ist es das mehrfache instanziieren von Modulklassen, wobei für mich der Grund dafür nicht ersichtlich ist, mit und ohne zugehöriger Sprachdatei, so das teilweise die Sprachkonstanten nicht definiert sind und zum andern nicht installierte Module bei denen dann Konstanten wie z.B. MODULE_ORDER_TOTAL_PS_FEE_SORT_ORDER nicht definiert werden da sie in der Datenbanktabelle configuration gar nicht vorhanden sind.
Eine einfach aber eigentlich nicht befriedigende Lösung sähe für mich so aus.
Die Zuweisungen der Konstanten in den Konstruktoren der Modulklassen, hier am Beispiel der class ot_subtotal, in der Datei includes/modules/order_total/ot_subtotal.php
$this->code = 'ot_subtotal';
$this->title = MODULE_ORDER_TOTAL_SUBTOTAL_TITLE;
$this->description = MODULE_ORDER_TOTAL_SUBTOTAL_DESCRIPTION;
$this->enabled = ((MODULE_ORDER_TOTAL_SUBTOTAL_STATUS == 'true') ? true : false);
$this->sort_order = MODULE_ORDER_TOTAL_SUBTOTAL_SORT_ORDER;
mit diesem Code zu ersetzen.
$this->title = $this->title = defined('MODULE_ORDER_TOTAL_SUBTOTAL_TITLE') ? MODULE_ORDER_TOTAL_SUBTOTAL_TITLE
: ''; $this->description = defined('MODULE_ORDER_TOTAL_SUBTOTAL_DESCRIPTION') ? MODULE_ORDER_TOTAL_SUBTOTAL_DESCRIPTION
: ''; $this->enabled = (((defined('MODULE_ORDER_TOTAL_SUBTOTAL_STATUS') ? MODULE_ORDER_TOTAL_SUBTOTAL_STATUS
: NULL) == 'true') ?
true : false); $this->sort_order = defined('MODULE_ORDER_TOTAL_SUBTOTAL_SORT_ORDER') ? MODULE_ORDER_TOTAL_SUBTOTAL_SORT_ORDER
: ''; PS:
Oben habe ich geschrieben, dass ich die Lösung eigentlich nicht für befriedigend halte, ein Grund dafür ist folgender. In der Datei admin/module.php ist an mehreren Stellen, aber nicht an ausreichend vielen, folgende Codesequenz zu finden.
if (is_file(DIR_FS_LANGUAGES
. $_SESSION['language'] . '/modules/' . $module_type . '/' . $file)) { include_once(DIR_FS_LANGUAGES
. $_SESSION['language'] . '/modules/' . $module_type . '/' . $file); } Obigen Code könnte man aber weglassen, wenn man stattdessen in den Moduldeiten jeweils vor der Klassendefinition folgenden beispielhaften Code einfügen würde.
include_once(DIR_FS_LANGUAGES . $_SESSION['language'] . '/modules/order_total/ot_subtotal.php');
Auf diese Weise ist dann nämlich gewährleistet, dass wenn man eine Moduldatei in ein Skript einbindet auch die zugehörige Sprachdatei immer mit eingebunden wird und man muss sich nicht mehr, wie das jetzt z.B. im Skript admin/module.php der Fall ist, speziell darum kümmern.
Gruss
Hanspeter