Skip to content
Snippets Groups Projects

Issue #3241715: Access check problems on add_to_template link

Closed Issue #3241715: Access check problems on add_to_template link
1 unresolved thread
1 unresolved thread
1 file
+ 28
26
Compare changes
  • Side-by-side
  • Inline
+ 28
26
@@ -113,34 +113,36 @@ class SectionLibraryRender implements TrustedCallbackInterface {
}
}
$add_template_to_library_url = Url::fromRoute(
'section_library.add_template_to_library',
[
'section_storage_type' => $params['section_storage_type'],
'section_storage' => $params['section_storage'],
'delta' => $params['delta'],
],
[
'attributes' => [
'class' => [
'use-ajax',
'layout-builder__link',
'layout-builder__link--add-template-to-library',
if (!empty($params)) {
Please register or sign in to reply
$add_template_to_library_url = Url::fromRoute(
'section_library.add_template_to_library',
[
'section_storage_type' => $params['section_storage_type'],
'section_storage' => $params['section_storage'],
'delta' => $params['delta'],
],
[
'attributes' => [
'class' => [
'use-ajax',
'layout-builder__link',
'layout-builder__link--add-template-to-library',
],
'data-dialog-type' => 'dialog',
'data-dialog-renderer' => 'off_canvas',
],
'data-dialog-type' => 'dialog',
'data-dialog-renderer' => 'off_canvas',
]
);
$add_to_template = [
'add_template_to_library' => [
'#type' => 'link',
'#title' => t('Add this template to library'),
'#url' => $add_template_to_library_url,
'#access' => $add_template_to_library_url->access(),
],
]
);
$add_to_template = [
'add_template_to_library' => [
'#type' => 'link',
'#title' => t('Add this template to library'),
'#url' => $add_template_to_library_url,
'#access' => $add_template_to_library_url->access(),
],
];
array_unshift($sections, $add_to_template);
];
array_unshift($sections, $add_to_template);
}
$elements['layout_builder'] = $sections;
Loading