Ich hab bei Contao 3.1 folgenden Fehler:
Warning: strpos() [function.strpos]: Offset not contained in string in system/modules/tags/dca/tl_content.php on line 23
#0 [internal function]: __error(2, 'strpos() [loadDataContainer('tl_content')
#4 contao/main.php(129): Contao\Backend->getBackendModule('news')
#5 contao/main.php(271): Main->run()
#6 {main}
Das Problem kann gelöst werden durch die Änderung in der entsprechenden Datei
Vorher
PHP-Code:
$pos = strpos($GLOBALS['TL_DCA']['tl_content']['palettes'][$key], '{', 2);
Nachher
PHP-Code:
if(substr_count($palette, '{') >= 2) {
$pos = strpos($palette, '{', 2);
}
Anmerkung
Beim nachsehen ist auch mir aufgefallen, dass die Programmierung noch entschlackt werden könnte.
Es wird folgendes deklariert:
PHP-Code:
$GLOBALS['TL_DCA']['tl_content']['palettes'] as $key => $palette
Innerhalb der Schleife steht dann überall:
PHP-Code:
$GLOBALS['TL_DCA']['tl_content']['palettes'][$key]
Stattdessen sollte man lieber verwenden:
Lesezeichen