Problem/Motivation

In
https://git.drupalcode.org/issue/photoswipe-3232070/-/commit/719e4c31b66...

The following code was added into the admin settings form build:

  public function buildForm(array $form, FormStateInterface $form_state) {
    $config = $this->configFactory->get('photoswipe.settings');
    if ($view_displays = \Drupal::entityTypeManager()->getStorage('entity_view_display')->loadMultiple(NULL)) {
      // Loop through all entity view displays:
      foreach ($view_displays as $view_display) {
        $components = $view_display->getComponents();
        foreach ($components as $componentName => $component) {
          if (!in_array($component['type'], [
            'photoswipe_field_formatter',
            'photoswipe_responsive_field_formatter',
          ])) {
            // None of our formatters are used, skip this component:
            continue;
          }
          if (!empty($component['third_party_settings']['fences'])) {
            // Explicitely set fences_field_items_wrapper_tag to 'none' if not existing yet.
            if (!isset($component['third_party_settings']['fences']['fences_field_items_wrapper_tag'])) {
              $component['third_party_settings']['fences']['fences_field_items_wrapper_tag'] = TagManagerInterface::NO_MARKUP_VALUE;
            }
            // Explicitely set fences_field_items_wrapper_classes to 'none' if not existing yet.
            if (!isset($component['third_party_settings']['fences']['fences_field_items_wrapper_classes'])) {
              $component['third_party_settings']['fences']['fences_field_items_wrapper_classes'] = TagManagerInterface::NO_MARKUP_VALUE;
            }
            // Save changes:
            $view_display->setComponent($componentName, $component)->save();
          }
        }
      }
    }

I have no clue how and why that happened, but it shouldn't :D Let's please remove that immediately :D

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork photoswipe-3380144

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Anybody created an issue. See original summary.

anybody’s picture

Assigned: Unassigned » grevil
Status: Active » Needs review
grevil’s picture

Yea... like discussed internally. No idea, this seems super unrelated.. no idea.

grevil’s picture

Status: Needs review » Reviewed & tested by the community

LGTM!

  • Grevil committed 181f2e6e on 5.x authored by Anybody
    Issue #3380144: Remove unwanted fences overwrites in admin settings form...
grevil’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.