After having created an initial panels page and variant, and configured it with a layout, I cannot go back and edit that variant and change to another variant. I can select them from the dropdown just fine, and get a message saying that the page is saved, but the configuration is not changed when I go back and edit the variant.
I would expect all my blocks to be moved to the first region of the new layout, allowing me to shuffle them into place afterwards.

I have tested this with a vanilla (minimal) install of Drupal 8.1-beta1 and latest Panels 8.x-3.x, as well as the dev version of Page Manager and latest alpha releases of Layout Plugin and CTools. I had some custom layouts in my theme, but it makes no difference whether I try this with those or the ones that come with Panels.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

achton created an issue. See original summary.

achton’s picture

Additional info: if I export the configuration and then manually alter the value of variant_settings.layout to the layout I need and re-import, it works.

jackalope’s picture

I experience the same thing using Panels 8.x-3.0-beta4; I mistakenly filed it as a page_manager issue.

rjbaron’s picture

Temporary workaround:
I am seeing the same issue when attempting to change it via the admin page, however I am able to change the variant layout if I am using the in place editor gui.

rcodina’s picture

Priority: Normal » Major

@rjbaron Thanks for the workaround!

doostinharrell’s picture

This appears to be an issue with the layout plugin selector code. I have a temporary fix that works against the latest dev release. Hope it helps someone.

doostinharrell’s picture

Status: Active » Needs review
phjou’s picture

I was about to look for the problem and patch it but hopefully I found this issue. The pach #6 works well for me. The Layout is correctly updated.
Moreover, it was really strange because the select value in the "Layout" tab couldn't be changed, but after clicking on the save button in the "Layout" tab, the content had the new correct structure in the "Content" tab.

Thank you for the patch.
Maybe it is time to make a new release, I had other problems earlier when I tried the actual release. I think the actual release is just too buggy to be used, but the dev branch seems pretty stable to me.

doostinharrell’s picture

Status: Needs review » Reviewed & tested by the community
phjou’s picture

Hello, the patch works well on this issue but it creates another bug for me. I am not able to create a new page with a variant anymore. It works well without the patch.

I have this error when I attempt to create a new page. It occurs just after choosing the layout:
Drupal\Component\Plugin\Exception\PluginNotFoundException: The "" plugin does not exist. in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 52 of core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php).

For information, I have found another person with the same error on this issue: https://www.drupal.org/node/2761795 but I'm not sure he applied the patch. Maybe it's a more complicated problem...

doostinharrell’s picture

Hi @phjou,

Are you running the latest dev release of ctools, pagemanager, and panels? I'm not able to reproduce the issue when using the latest versions. I would update and re-patch. I also had that error message before updating as well.

phjou’s picture

I am on the latest release (dev branch) of all these modules and I still have the bug at the creation of a new page after choosing the layout. The only difference is that I have a patch on ctools: https://www.drupal.org/files/issues/ctools_2672110_16.patch
I haven't tested if the patch is the cause of our difference, but I don't really see why this patch could be the reason of that difference of behaviour.

Concerning panels, I think that the code which was in the "else" that you put in the "if" should always be done. I have done a patch and it seems to be ok for me in both cases: "change the layout" and "create a new page".

icicleking’s picture

I have the same issue. I will test patches against the latest dev releases when time allows.

japerry’s picture

The last submitted patch, 6: cannot_switch_variant_layout-2687483.patch, failed testing.

samuel.mortenson’s picture

Status: Reviewed & tested by the community » Needs review

The patch from #6 failed tests and was reviewed by the person submitting it, and the patch from #12 has not been reviewed. Moving back to Needs Review.

dobrzyns’s picture

I applied the patch from #12 and tested this with Drupal 8.2.0-rc1 and the dev version of panels. The Layout dropdown disappeared and instead the "Builder" dropdown appeared. However, I can successfully change the layout using the in-place editor.

With Patch and Without Patch Comparison

The "layout" dropdown also doesn't appear with the standard builder:

Only local images are allowed.

phjou’s picture

FileSize
68.41 KB

Hi,
I want to reproduce your problem but I'm confused about your interface, it doesn't look like mine on my screen with a 8.1.10 Drupal installation.
I'm using page_manager, layout_plugin and panels but I have this interface (attached image) which is pretty different. I can change the builder in the "General" tab and the layout in the "Layout" tab but not both at once.

panels screenshot

Could you tell me exactly which modules do you have? Only panels? Thank you for testing my patch, I will try to reproduce your problem when I will have some time.

icicleking’s picture

japerry’s picture

dobrzyns’s picture

@phjou That was my bad. I must have thought I had the dev version of both panels and page_manager and didn't.

The patch in #12 works great on an existing site.

dobrzyns’s picture

Status: Needs review » Reviewed & tested by the community
DamienMcKenna’s picture

FYI nplowman added a patch for this in #2824632: Changes to Layout not being saved that is almost identical to this patch. I'm not sure which is the correct approach, both appear to (mostly) work, but this is the older one.

  • japerry committed 9279ce8 on 8.x-3.x
    Issue #2687483 by phjou, doostinharrell, dobrzyns: Cannot switch variant...
japerry’s picture

Status: Reviewed & tested by the community » Fixed

Looks good to me. Fixed.

  • japerry committed 9279ce8 on 8.x-4.x
    Issue #2687483 by phjou, doostinharrell, dobrzyns: Cannot switch variant...

Status: Fixed » Closed (fixed)

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