In Admin.js files thows new error.
`
read_config: function() {
var data = $('[data-sonata-admin]').data('sonata-admin');
this.config = data.config; <------
this.translations = data.translations;
},
`
I have the last 3.40.1
I have the same exact error after upgrading from 3.39.0 to 3.40.1.
You probably have custom standard_layout.html.twig?
and overwriting body_attributes block.
ex:
{% block body_attributes %}class="sonata-bc login-page"{% endblock %}
which contain the initialization of data-sonata-admin in the standard_layout.html.twig like :
{% block body_attributes %}
class="sonata-bc skin-{{ colorScheme['color'] }} fixed
{% if app.request.cookies.get('sonata_sidebar_hide') -%}
sidebar-collapse
{%- endif -%}"
data-sonata-admin='{{ {
config: {
CONFIRM_EXIT: sonata_admin.adminPool.getOption('confirm_exit') ? 'true' : 'false',
USE_SELECT2: sonata_admin.adminPool.getOption('use_select2') ? 'true' : 'false',
USE_ICHECK: sonata_admin.adminPool.getOption('use_icheck') ? 'true' : 'false',
USE_STICKYFORMS: sonata_admin.adminPool.getOption('use_stickyforms') ? 'true' : 'false'
},
translations: {
CONFIRM_EXIT: 'confirm_exit'|trans({}, 'SonataAdminBundle'),
},
}|json_encode()|raw }}'
{% endblock %}
which lead to the JS issue.
JS code should check existing of data-sonata-admin attribute on body or fix your custom layout.
see #5256
The PR waiting merge is #5262
uld check existing of data-sonata-admin attribute on body or fix your custo
Yes, that's correct. Thanks for the help.
Yes it works. Thanks Webonaute
Thank you for the feedback
Most helpful comment
You probably have custom standard_layout.html.twig?
and overwriting body_attributes block.
ex:
which contain the initialization of data-sonata-admin in the standard_layout.html.twig like :
which lead to the JS issue.
JS code should check existing of data-sonata-admin attribute on body or fix your custom layout.