Skip to content

Commit

Permalink
Issue #3457046: Code comments in wxt_ext_layout say to remove these
Browse files Browse the repository at this point in the history
  • Loading branch information
Joseph Olstad authored and sylus committed Jul 1, 2024
1 parent 7e51a34 commit f21ec0b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 40 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"drupal/migrate_plus": "^6.0",
"drupal/migrate_tools": "^6.0",
"drupal/page_manager": "4.0-rc2",
"drupal/panels": "^4.7",
"drupal/panels": "^4.8",
"drupal/paragraphs": "^1.15",
"drupal/password_policy": "^4.0",
"drupal/pathauto": "^1.12",
Expand Down
39 changes: 0 additions & 39 deletions modules/custom/wxt_ext/wxt_ext_layout/wxt_ext_layout.module
Original file line number Diff line number Diff line change
Expand Up @@ -228,42 +228,3 @@ function wxt_ext_layout_entity_get_form_display($entity_type, $bundle, $form_mod
return $entity_form_display;
}

/**
* Implements hook_module_implements_alter().
*
* @todo Remove when we require Panels 4.5 or later, since it implements and
* tests this functionality itself.
*/
function wxt_ext_layout_module_implements_alter(array &$implementations, $hook) {
if ($hook === 'layout_alter') {
unset($implementations['panels']);
}
}

/**
* Implements hook_layout_alter().
*
* @todo Remove when we require Panels 4.5 or later, since it implements and
* tests this functionality itself.
*/
function wxt_ext_layout_layout_alter(array &$definitions) {
$core_layouts = [
'layout_onecol',
'layout_twocol',
'layout_twocol_bricks',
'layout_threecol_25_50_25',
'layout_threecol_33_34_33',
];
foreach ($definitions as $layout_name => $layout) {
// Verify that the layout definition is a LayoutDefinition.
if (!($definitions[$layout_name] instanceof LayoutDefinition)) {
continue;
}
if (in_array($layout_name, $core_layouts) && empty($definitions[$layout_name]->getIcon())) {
$definitions[$layout_name]->setIconPath(\Drupal::service('extension.list.module')->getPath('panels') . '/layouts/' . $layout_name . '/' . $layout_name . '.png');
}
if (empty($definitions[$layout_name]->getIcon())) {
$definitions[$layout_name]->setIconPath(\Drupal::service('extension.list.module')->getPath('panels') . '/layouts/no-layout-preview.png');
}
}
}

0 comments on commit f21ec0b

Please sign in to comment.