Commit 27132ad6 authored by git's avatar git Committed by Damien McKenna
Browse files

Issue #3261505 by DamienMcKenna, Eugene Bocharov, Sergiu Stici: In php 8.1 the...

Issue #3261505 by DamienMcKenna, Eugene Bocharov, Sergiu Stici: In php 8.1 the explode function throws a notice when default value is null.
parent f8020572
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -9,6 +9,8 @@ Metatag 8.x-1.x-dev, 2022-xx-xx
  Error: Call to a member function __wakeup() on null.
#3113761 by DamienMcKenna, thalles, rokzabukovec, Diego_Mow, urvashi_vora:
  Coding standards cleanup.
#3261505 by DamienMcKenna, Eugene Bocharov, Sergiu Stici: In php 8.1 the explode
  function throws a notice when default value is null.


Metatag 8.x-1.19, 2022-01-06
+7 −8
Original line number Diff line number Diff line
@@ -157,16 +157,15 @@ class MetatagDefaultsForm extends EntityForm {
    $entity_type_groups = $settings->get('entity_type_groups');

    // Find the current entity type and bundle.
    $metatag_defaults_id = $metatag_defaults->id();
    if ($metatag_defaults_id = $metatag_defaults->id()) {
      $type_parts = explode('__', $metatag_defaults_id);
      $entity_type = $type_parts[0];
    $entity_bundle = isset($type_parts[1]) ? $type_parts[1] : NULL;
      $entity_bundle = $type_parts[1] ?? NULL;
    }

    // See if there are requested groups for this entity type and bundle.
    $groups = !empty($entity_type_groups[$entity_type]) && !empty($entity_type_groups[$entity_type][$entity_bundle]) ? $entity_type_groups[$entity_type][$entity_bundle] : [];
    // Limit the form to requested groups, if any.
    if (!empty($groups)) {
      $form = $this->metatagManager->form($values, $form, [$entity_type], $groups, NULL, TRUE);
    if (isset($entity_type) && !empty($entity_type_groups[$entity_type]) && !empty($entity_type_groups[$entity_type][$entity_bundle])) {
      $form = $this->metatagManager->form($values, $form, [$entity_type], $entity_type_groups[$entity_type][$entity_bundle], NULL, TRUE);
    }
    // Otherwise, display all groups.
    else {