madeyourday/contao-rocksolid-custom-elements

Custom elements are not assigned to user groups during Contao 4.9 migration

dmolineus opened this issue · 2 comments

When I update a Contao 4.4 project the CeAccessMigration of Contao assigns all existing elements/module to every user group. This works but not for rocksolid custom elements. They are ignored. It looks like that the config is not processed in the install tool/migration command.

public static function loadConfig($bypassCache = false)
{
// Don't load the config in the install tool
try {
if (
\System::getContainer()->get('request_stack')
&& \System::getContainer()->get('request_stack')->getCurrentRequest()
&& in_array(
\System::getContainer()->get('request_stack')->getCurrentRequest()->get('_route'),
['contao_install', 'contao_backend_install'],
true
)
) {
return;
}
}

I'm not sure if the issue occurs in the install tool and migration command, or only in one of this cases.

ausi commented

Does the issue get resolved if you remove the following lines?

// Don't load the config in the install tool
try {
if (
\System::getContainer()->get('request_stack')
&& \System::getContainer()->get('request_stack')->getCurrentRequest()
&& in_array(
\System::getContainer()->get('request_stack')->getCurrentRequest()->get('_route'),
['contao_install', 'contao_backend_install'],
true
)
) {
return;
}
}
catch (\Exception $exception) {
return;
}

ausi commented

Should be fixed with 1493e60