Commit 50fa9d86 authored by Tom Keitel's avatar Tom Keitel
Browse files

Issue #3285271 by hctom: Drupal 9.4 compatibility

parent 3898aa33
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -9,6 +9,12 @@
  <exclude-pattern>*/icons/*</exclude-pattern>
  <exclude-pattern>*/vendor/*</exclude-pattern>

  <!--
  @todo Remove temporary fix when drupal.org testbot script is changed.
    See https://www.drupal.org/node/3283978
  -->
  <config name="installed_paths" value="../../drupal/coder/coder_sniffer/,../../sirbrillig/phpcs-variable-analysis/,../../slevomat/coding-standard/"/>

  <rule ref="Drupal"/>
  <rule ref="DrupalPractice"/>
</ruleset>
+1 −1
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@ class ViewModeSwitchWidget extends WidgetBase {
   * {@inheritdoc}
   */
  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state): array {
    $value = isset($items[$delta]->value) ? $items[$delta]->value : '';
    $value = $items[$delta]->value ?? '';

    // Determine view modes allowed to switch to.
    $options_provider = $this->fieldDefinition
+1 −1
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ class ViewModeHelper implements ViewModeHelperInterface {
   * {@inheritdoc}
   */
  public function getName(EntityViewModeInterface $entity): string {
    list(/* Entity type */, $name) = explode('.', (string) $entity->id());
    [/* Entity type */, $name] = explode('.', (string) $entity->id());

    return $name;
  }
+3 −1
Original line number Diff line number Diff line
@@ -122,7 +122,9 @@ class ViewModeSwitchTest extends ViewModeSwitchTestBase {
    $this->assertEquals('Recursion detected when trying to switch %origin_view_mode view mode via %view_mode_switches.', $log->message);

    // Test recursion detection log message context.
    $variables = unserialize($log->variables);
    $variables = unserialize($log->variables, [
      'allowed_classes' => FALSE,
    ]);
    $this->assertIsArray($variables);
    $this->assertEquals('foo', $variables['%origin_view_mode']);
    $this->assertEquals('foo › foo1 › foo', $variables['%view_mode_switches']);