Closed (fixed)
Project:
Panels
Version:
8.x-4.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 May 2017 at 11:42 UTC
Updated:
16 May 2017 at 17:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
alexrayu commentedI am having this issue with a fresh installation of Drupal with the page manager installed with composer.
Comment #3
alexrayu commentedBreaks site, bump to major.
Comment #4
alexrayu commentedDid some fast debugging - the discovery's doGetDefinition() ends up receiving a list of LayoutDefinitions rather than plugin definitions.
Versions:
ctools: 8.x-3.0
page manager: 8.x-4.0-beta2
panels: 8.x-4.0
panelizer: 8.x-4.0
Backtrace:
Comment #5
alexrayu commentedThe issue is in panels, moving the issue.
Comment #6
alexrayu commentedThe plugin selector form does not apply the selected layout on form submit within the wizard, which created the issue. For me, the fast solution has been the attached patch. Please review.
Comment #7
alexrayu commentedApologies! The correct patch attached.
Comment #8
phenaproximaI was reproducing this problem on Panels 4.0. I applied the patch in #7 and it instantly fixed the problem for me. It seems to me that this will need a regression test before commit, though. Thank you, @alexrayu!!
Comment #9
phenaproximaWelp, according to @tim.plunkett, the branch tests are failing without this fix. So I guess a regression test is not needed. In which case...I came, I saw, I tried the patch, it worked. That's an RTBC as far as I'm concerned.
Comment #10
tim.plunkettTests passed last time we rolled a release, 8.x-4.0-beta1. They are failing in 8.x-4.0.
I began with
(first is the most recent known bad commit, second is the most recent known good commit).
At each step of the way, bisect checks out a new hash, and you must tell it if the commit is good or bad.
To determine if the commit was good, I ran
And the first two times, the test failed, so I ran
Because there were only a few commits, I only had to do this a couple times before git informed me of the breaking commit: #2873767: Tabledrag from change layouts doesn't work
The change to src/Form/LayoutPluginSelector.php in that patch seems to be exactly the problem.
However, I do not think the above fix is 100% right.
The correct fix would be
$variant_plugin->setLayout($form_state->getValue('layout'), $form_state->getValue('layout_settings') ?: []);inside that new else{} block.
The above patch makes little sense to me, since
$cached_values['plugin']is immediately overwritten.Furthermore, it does not take into account the
'layout_settings'portion.Retagging for test coverage.
EDIT:
Just tested this with
git bisect run, and it seems to work great!and that automatically found the right commit. Cool!
Comment #11
alexrayu commentedUploading the updated patch with corrections requested by @tim.plunkett
Comment #12
phenaproximaI discussed this with @tim.plunkett on Slack and we realized that the test coverage is complete as-is, and does catch this. Furthermore, the
$form_state->getValue('layout_settings') ?: []bit of the patch in #11 is unnecessary. Why? Because the LayoutPluginSelector form doesn't mention layout_settings in its buildForm() method. The layout settings are configured in the next step of the wizard, which is a separate form. Indeed, the existing PanelsTest asserts for this.I have confirmed that PanelsTest passes locally with this patch applied, and fails without it. I think we can safely say it's RTBC by this point.
Comment #14
japerryBased on the major regression we're getting here, and the fact that adding the else around what was the old code seems to fix the 'change layout' functionality that was previously broken, it looks like we can commit this.
Rolling a 4.1 release as well.
Comment #15
parijke commentedI checked the patch. The problem mentioned is solved.
Many thanks
Comment #16
seyfettinkahveci commentedI see that this problem is solved in the newest version of the module. Thanks
Comment #17
parijke commented