Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

after update to 4.7.2 error preg_match() #3

Closed
tim5chneider opened this issue Apr 3, 2019 · 5 comments
Closed

after update to 4.7.2 error preg_match() #3

tim5chneider opened this issue Apr 3, 2019 · 5 comments

Comments

@tim5chneider
Copy link

after update to 4.7.2 you can't edit articles.

Log Error:
[2019-04-03 15:12:41] request.CRITICAL: Uncaught PHP Exception TypeError: "preg_match() expects parameter 2 to be string, null given" at /var/www/html/.../vendor/contao/core-bundle/src/DataContainer/PaletteManipulator.php line 199 {"exception":"[object] (Symfony\Component\Debug\Exception\FatalThrowableError(code: 0): preg_match() expects parameter 2 to be string, null given at /var/www/html/.../vendor/contao/core-bundle/src/DataContainer/PaletteManipulator.php:199)"} []

app_dev | TypeError in

in vendor/inspiredminds/contao-wowjs/src/Resources/contao/dca/tl_content.php->applyToPalette (line 190) ->applyToPalette($key, 'tl_content');

After uninstalling this package, it worked again.

Are you still maintaining this package?

@fritzmg
Copy link
Contributor

fritzmg commented Apr 3, 2019

I am unable to reproduce the error. Can you please post the complete stack trace?

@tim5chneider
Copy link
Author

TypeError:
preg_match() expects parameter 2 to be string, null given

  at vendor/contao/core-bundle/src/DataContainer/PaletteManipulator.php:199
  at preg_match('#\\{(.+?)(:hide)?\\}#', null, array('{data_attributes_legend}', 'data_attributes_legend'))
     (vendor/contao/core-bundle/src/DataContainer/PaletteManipulator.php:199)
  at Contao\CoreBundle\DataContainer\PaletteManipulator->explode('{type_legend},type;{data_attributes_legend},add_data_attributes;')
     (vendor/contao/core-bundle/src/DataContainer/PaletteManipulator.php:139)
  at Contao\CoreBundle\DataContainer\PaletteManipulator->applyToString('{type_legend},type;{data_attributes_legend},add_data_attributes;')
     (vendor/contao/core-bundle/src/DataContainer/PaletteManipulator.php:119)
  at Contao\CoreBundle\DataContainer\PaletteManipulator->applyToPalette('default', 'tl_content')
     (vendor/inspiredminds/contao-wowjs/src/Resources/contao/dca/tl_content.php:190)
  at Contao\DcaLoader->{closure}(object(DC_Table))
     (vendor/contao/core-bundle/src/Resources/contao/drivers/DC_Table.php:207)
  at Contao\DC_Table->__construct('tl_content', array('tables' => array('tl_article', 'tl_content'), 'table' => array('contao.controller.backend_csv_import', 'importTableWizardAction'), 'list' => array('contao.controller.backend_csv_import', 'importListWizardAction')))
     (vendor/contao/core-bundle/src/Resources/contao/classes/Backend.php:397)
  at Contao\Backend->getBackendModule('article', null)
     (vendor/contao/core-bundle/src/Resources/contao/controllers/BackendMain.php:169)
  at Contao\BackendMain->run()
     (vendor/contao/core-bundle/src/Controller/BackendController.php:48)
  at Contao\CoreBundle\Controller\BackendController->mainAction()
     (vendor/symfony/http-kernel/HttpKernel.php:150)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
     (vendor/symfony/http-kernel/HttpKernel.php:67)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
     (vendor/symfony/http-kernel/Kernel.php:198)
  at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
     (web/app_dev.php:83)

@fritzmg
Copy link
Contributor

fritzmg commented Apr 3, 2019

This error is caused by the add_data_attributes extension, which creates an invalid palette. You need to tell the developer of the extension to make the following change in dca/tl_content.php:

-        $GLOBALS['TL_DCA']['tl_content']['palettes'][$key] .= ';{data_attributes_legend},add_data_attributes;';
+        $GLOBALS['TL_DCA']['tl_content']['palettes'][$key] .= ';{data_attributes_legend},add_data_attributes';

(or just adjust it yourself)

@fritzmg
Copy link
Contributor

fritzmg commented Apr 3, 2019

See also contao/contao#421

@fritzmg fritzmg closed this as completed Apr 3, 2019
@tim5chneider
Copy link
Author

Thanks for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants