I have an entity with view mode "Default". The view mode uses a Display Suite layout (One column).

On another installation, I set the layout to "- None -", reverting the view mode back to the original template. I then export the settings via YML, and re-import them on my main installation.

However, after the config import, the entity's view mode still uses the DS layout. The changes from the config aren't applied.

The problem might be that this piece of config is responsible for the layout:

core.entity_view_display...default.yml

third_party_settings:
  ds:
    layout:
      id: ds_1col
      path: modules/ds
      library: ''
      disable_css: false
      settings:
        wrappers:
          ds_content: div
        outer_wrapper: div
        attributes: ''
        link_attribute: ''
        link_custom: ''
        classes:
          layout_class: {  }
      entity_classes: old_view_mode
    regions:
      ds_content:
        - field_pg_tl_teasers

When you return the display mode to DS layout "- None -", those lines are simply removed from the config. Apparently, the absence of these settings does not force them to be cleaned out.

Comments

ividyon created an issue. See original summary.

yoruvo’s picture

Issue summary: View changes
yoruvo’s picture

Issue summary: View changes
swentel’s picture

Status: Active » Postponed (maintainer needs more info)

If you save the field ui screen after setting back to none, the third party settings should be gone no after export ? If not, then either something went wrong during the save for some reason. Could you double check that everything is gone, because I can't reproduce this atm.

GaëlG’s picture

I had the same problem with drupal 8.2.7 and ds 2.6. I manually changed the yml to third_party_settings: no and it worked.

aspilicious’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)
weseze’s picture

Category: Bug report » Support request
Status: Closed (works as designed) » Active

@aspilicious: Works as designed... Can you please explain then how this can be fixed? Is it a core issue? A config-contrib module issue?
Because this still isn't working on the latest D8.3 core and the latest ds versions.

Adding a line "third_party_settings: no" (as suggested by @GaëlG), importing config and everything works again. But this line is never added unless you manually put it there. So for every entity type it needs to be added manually?

Seems to me like there is still some kind of issue here, although I'm unsure if it is something with display suite itself or not...

larowlan’s picture

Category: Support request » Bug report

I can confirm this issue.

To fix it, you have to manually change it to third_party_settings: {}

If you do that and import, but then re-export, it keeps coming back. So there must be something awry here or in core's handling of empty third party settings.

larowlan’s picture

Version: 8.x-2.x-dev » 8.x-3.x-dev

Still exists in 8.x-3.x

aspilicious’s picture

"If you do that and import, but then re-export, it keeps coming back. So there must be something awry here or in core's handling of empty third party settings."

Shouldn't this be a core bug than instead of a DS bug?

larowlan’s picture

Assigned: Unassigned » larowlan

I will need to do some debugging to find out where they come from

aspilicious’s picture

Status: Active » Postponed (maintainer needs more info)
larowlan’s picture

This core patch #3030647: Do not add a section when editing an empty layout, or differentiate between new layouts and existing empty layouts has a possible solution/cause here - you can't call setThirdPartySettings with an empty array, you have to use unset.

So perhaps that's what is happening with a config import

swentel’s picture

I've tried reproducing this. Configured a layout, went to import screen and it showed me the differences (removing all third party settings) and the layout was reset, so not sure if this still a problem with Drupal Core 8.6.x - Or am I missing a step ?

swentel’s picture

Version: 8.x-3.x-dev » 5.0.x-dev

No response for a long time, reopen if there's more info.

swentel’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)