When I create a layout in Panels > Layouts and try to delete a region by clicking X icon, it is disappearing, but after clicking Save button, layout is reloading without any modifications.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

big_smile’s picture

If you move a region around after clicking the X button, then the changes will save and so the region will not come back.
If you don't move a region, then the changes do not save.

The above only applies if you are using Spark.

If you install Layout on a fresh Drupal website (i.e. without Spark) then it seems to be impossible to save your regions.

On my fresh Installation, I made sure I had the following modules installed before installing Layout:
jquery_update (Dev version)
Libraries (Dev Version)
I also ensured Jquery update was set to use 1.7.1
I also installed the Dev version of Layout.

Despite this, it seems to be impossible to save the placement of regions (without using Spark).

Does Spark install something special to make Layout work?

I would imagine that not be able to save edits to region positioning would be a high priority bug, as it renders the module virtually useless!

On fresh install, you can still make edits under the "Site Builders" option of Panels, but this isn't as useful as being able to create a separate layout.

das-peter’s picture

Status: Active » Needs review
FileSize
1.15 KB

For me it looks like the event regionRemoved isn't fired and thus Drupal.responsiveLayout.recordState is never called.
I've changed LayoutManager.prototype.removeRegion to fire the event in every case and now it seems to work.
But I'm not aware if there are cases in which the event shouldn't be fired!

jessebeach’s picture

Status: Needs review » Closed (fixed)

Thanks @das-peter. I commited this patch and pushed to the 7.x-1.x branch.

SHA: 5d6cf23ec3b9956c70b0d68e0955f3bb22b0fd38

das-peter’s picture

Status: Closed (fixed) » Fixed

@jessebeach Thank you very much!
Let's use the status fixed, the bot will close it anyway. But others have a chance to see that there was a change / fix.

webchick’s picture

Version: 7.x-1.x-dev » 8.x-1.x-dev
Status: Fixed » Patch (to be ported)

8.x-1.x needs this too.

Gábor Hojtsy’s picture

Status: Patch (to be ported) » Fixed

Also committed to layout 8. I did not find other commits that might be on the 7 branch, not the 8 branch, so we should be in sync.

big_smile’s picture

Version: 8.x-1.x-dev » 7.x-1.x-dev
Status: Fixed » Active

Is this fixed for the 7.1.Dev version?
I have tried installing the dev version on both an existing and brand new site (which is not using Spark), but it still doesn't seem to work.

das-peter’s picture

Version: 7.x-1.x-dev » 8.x-1.x-dev
Status: Active » Fixed

@big_smile Please read more carefully:
#1783228-3: Removing region doesn't work:

Thanks @das-peter. I commited this patch and pushed to the 7.x-1.x branch.

#1783228-6: Removing region doesn't work:

Also committed to layout 8. I did not find other commits that might be on the 7 branch, not the 8 branch, so we should be in sync.

Extracted information: Patch was applied and committed to both branches (7.x and 8.x) there's no need to use the patch if you use the latest development versions.

big_smile’s picture

Version: 8.x-1.x-dev » 7.x-1.x-dev
Status: Fixed » Active

Thanks for taking the time to reply!
In my post I was talking about the latest dev version (and not the patch).

Just to confirm: Does the Dev version work on a non spark site?
I have installed the Dev version (not the patch) on both an existing and brand new site* (neither which are using Spark), but it still doesn't seem to work.

Thanks for any help!

[*}both sites are Drupal 7, with the latest versions of all modules.
Jquery update has been set to version 1.7

das-peter’s picture

Hmm, I actually never tried to use this module without all the other spark related modules.
Thus I can't provide a qualified answer to your question.
However, I suggest to check for javascript errors - this is a good first step for debugging this.

big_smile’s picture

Here are the error in the console:

[RLD | RegionList] The RegionList instance has no Regions at setup. main.js:34
[RLD | LayoutList] The list has no items at setup. main.js:34
[RLD | LayoutList] The list has no items at setup. main.js:34
[RLD | InitClass] Item not found in this set. main.js:34
[RLD | InitClass] Item not found in this set. main.js:34

PS. Thank you for such an awesome module. Every time I use it, I think I am in the future - it's that good!

das-peter’s picture

Hmm, that are not really JS errors but log messages of the library. I've to check if I have something similar in my log.

Gábor Hojtsy’s picture

I've seen such issues before if my layout was saved "corrupted". You can try a brand new layout (and reset the default layout to the shipped default, new layouts are created from the default layout).

das-peter’s picture

I see something similar:

[RLD | RegionList] The RegionList instance has no Regions at setup. main.js:34
[RLD | RegionList] The RegionList instance has no Regions at setup. main.js:34
[RLD | LayoutList] The list has no items at setup. main.js:34
[RLD | LayoutList] The list has no items at setup. main.js:34

Now, since this seems to be a "special case" you're dealing with I suggest you to open an new issue.
Check if a Spark installation works for you. If so, start disabling spark modules and see after which one the functionality is broken. If you can provide that information you'll have a good chance someone can take care of the issue.

lias’s picture

I was having issues with being able to modify default and custom layout. I do not have Spark installed on this site so needed to copy over the Panels module from the Spark distribution to my Drupals 7.16 site. Now that I've done that, my responsive region changes are sticking.