WebsiteBaker Community Forum

WebsiteBaker Support (2.11.x) => General Help & Support => Topic started by: Gast on February 15, 2018, 12:08:00 AM

Title: multi-dimensional language-variabel-arrays deprecated
Post by: Gast on February 15, 2018, 12:08:00 AM
Since the beginning of 2010, multi-dimensional language variable arrays have been on the list of "outdated functions", which means that these variables will sooner or later no longer work, are no longer supported by WB.
Colloquially, they are known in WB as a double language index. A few examples of old indices:

All active module developers know or knew about this and have implemented it as a rule, but a lot of things have only happened in the last year, since a bug has been logged into WB. Since the introduction of the simple language indexes, several double variables have been collected in a separate file and then re-integrated via the integration of the language files in order to catch possible errors.
This, in turn, made it unnecessary for the authors to correct the old double indexes as well, since there was never really a compulsion to do so, but of course our own guidelines were undermined. Since WB 2.10 (?) or as one of the first steps for WB 2.11 there was probably already an error message about a double language index, but it almost never came into effect, because the double index was still available via the collection file (languages/old. format. inc. php).
This collective file has now disappeared in 2.11, because otherwise the actual problem cannot be solved. The respective module continues to function in such cases, but may not display such a message. If such a problem is reported (error message from the error. log), a solution is always available in real time. If it is a module that is offered in the add-ons, a prompt correction is also made.
An example of such an error message
Quote
2018-02-14T10:52:13+00:00[E_NOTICE] /modules/imagegallery/save. php:[112] from /modules/imagegallery/save. php:[112] WbErrorHandler "Undefined index: PAGES"

The correction is quite simple. In a double index, only the front and rear part must be connected to an underscore in a double index.
A concrete example:
double index
Quote
$MESSAGE[' PAGES'][' SAVED']

The red marked part is removed and an underscore is inserted.
corrected index
Quote
$MESSAGE[' PAGES_SAVED']

Even if the correction seems to be easy and probably feasible for everyone with the help of this manual, we ask you to report every old double index found. This helps us to correct the old modules.

Translated with www.DeepL.com/Translator

in German:
Seit Anfang 2010 stehen multi-dimensionale Sprachvariable-Array auf der Liste der "outdated Functions", das heißt, diese Variablen werden früher oder später nicht mehr funktionieren, werden von WB nicht mehr unterstützt.
Umgangssprachlich sind sie in WB bekannt als Doppelter Sprachindex. Ein paar Beispiele alter Indizes:

Alle aktiven Modulentwickler wissen oder wußten Bescheid und haben das in aller Regel auch umgesetzt, vieles ist aber erst im letzten Jahr passiert, seit in WB auch ein Fehler dafür mitgeloggt wurde. Seit Einführung der einfachen Sprachindizes wurden in einer separaten Datei noch diverse Doppelvariablen gesammelt und über die Einbindung der Language-Dateien dann doch wieder eingebunden, um ggf mögliche Fehler abzufangen.
Das wiederum machte es den Autoren wohl auch überflüssig, die alten doppelten Indizes auch zu korrigieren, es bestand ja nie wirklich ein Zwang dafür, aber damit wurden natürlich auch unsere eigenen Vorgaben unterwandert. Seit WB 2.10 (?) oder als eines der ersten Schritte für WB 2.11 gab es wohl schon die Fehlermeldung über einen doppelten Sprach-Index, der aber so gut wie nie in Kraft trat, weil der doppelte Index ja über die Sammeldatei (languages/old.format.inc.php) dennoch vorhanden war.
Diese Sammeldatei ist nun in der 2.11 verschwunden, weil sonst das eigentliche Problem nie lösbar ist. Das jeweilige Modul funktioniert in solchen Fällen weiter, zeigt aber ggf eben solche Meldung nicht mehr an. Sofern solch Problem gemeldet wird (Fehlermeldung aus der error.log), ist eigentlich auch immer und zeitnah eine Lösung vorhanden. Sofern es sich um ein Modul handelt, das im Addons angeboten wird, erfolgt auch eine zeitnahe Korrektur.
Ein Beispiel für solche Fehlermeldung
Quote
2018-02-14T10:52:13+00:00 [E_NOTICE] /modules/imagegallery/save.php:[112] from /modules/imagegallery/save.php:[112] WbErrorHandler "Undefined index: PAGES"

Die Korrektur ist recht einfach. Es muß in einem doppelten Index nur der vordere und hintere Teil mit einem Unterstrich verbunden werden
Konkretes Beispiel:
doppelter Index
Quote
$MESSAGE['PAGES']['SAVED']

Entfernt wird der rot markierte Teil, eingefügt wird ein Unterstrich.
korregierter Index
Quote
$MESSAGE['PAGES_SAVED']

Auch, wenn die Korrektur mit Hilfe dieser Anleitung einfach und wohl von jedem durchführbar scheint, bitten wir um Meldung jedes gefundenen alten Doppel-Index