- Issue created by @JWBrown
When using Section Library, attempting to go to the Layout tab of certain nodes may cause an out of memory error.
This was not always reproducible in our site, but it was consistently reproducible for a certain node. It did not seem to be related to the number of sections in the library, as it still happened after deleting all of the sections from the library.
We did not delve into the Section Library code. Because the Section Library module is so valuable for our content editors, and we were on a deadline, we elected to try to workaround this issue. We followed the advice in https://acquia.my.site.com/s/article/360004542293-Conditionally-increasi.... Increasing the memory limit for the node layouts solved the problem. (Note that care must be taken when increasing memory limits).
We used this code snippet in settings.php to increase memory for Layout Builder:
$admin_paths = array(
'admin',
'node/%node/layout',
'section_library/import'
);
// standardize node layout paths for validation
$current_path = preg_replace("/\d+/", '%node', $uri);
foreach ($admin_paths as $admin_path) {
if (strpos($current_path, $admin_path) !== false) {
ini_set('memory_limit', '256M');
}
}
Active
1.1
Code