Bug #23257 See Comments

Setting up a channel layout is prone to error

Version: 3.5.11 Reporter: dgtlmkt

I have a channel with 17 fields and a layout with 7 tabs.

When I move fields from tab to tab, EE will frequently not respect my layout changes. Half of the time after saving my layout, a field won’t move to another tab. The other half, the order I set up in the tab is not correct.

The only workaround I have found is to write a script that will unserialize the layout from the exp_layout_publish table, manually specify the correct order by rewriting the array, and then serialize it and update the exp_layout_publish table. This is extremely tedious and I would prefer that EE save the layout correctly.

Is there a solution to this problem?

  • I agree that working around your issue by manually manipulating the data would be extremely tedious and I empathize. What browser are you using, and are you able to replicate this on a new installation by chance? If so, can you give us the steps to reproduce? Any third-party add-ons with Tab components? We have had a few folks with intermittent problems like you describe, but not with a replicable case that would allow us to identify the problem. For those folks deleting the layout altogether and starting over fixes it, but that’s not ideal either. I’d love to nip this one in the bud.

    Derek Jones
    26th October, 2017 at 10:45am
  • Sorry, I should have mentioned that before. Chrome 61 on OS X Yosemite. I have not yet tried to reproduce it in other browsers.

    I can’t regularly reproduce it. If I do too many things in one go, like reorder fields and then move other fields into another tab, then there is a good chance it’ll happen. (I failed to mention that another workaround is doing one layout change at a time between saves.)

    My EE3 installation is new, spun up on Monday in my local dev environment. No addons with tab components - the only installed addon is Solspace Freeform Next Pro.

    I don’t know if any of this helpful. It isn’t a showstopper, but when it comes up it is tedious, like you said. Thanks for responding Derek.

    dgtlmkt
    26th October, 2017 at 11:03am
  • Thanks for the extra details. When it happens again, can you check your browser console for any JS errors? I wonder if there’s a race condition with it trying to apply the actions that is somehow corrupting the array.

    Derek Jones
    26th October, 2017 at 11:15am
  • Okay, so I was able to recreate it.

    1. Defined a few new fields.
    2. Created a new tab.
    3. Moved four of the new fields from the default Publish tab to the newly created Content Blocks tab.
    4. Clicked Save Layout.

    When I looked at the layout again, I found that the fourth field had stayed put, and the Name field had moved instead. Additionally, the order I laid out in the new tab was no longer in place.

    I never saw an error in Chrome’s console, but these notices did appear:

    jquery.js?v=1508964951:3 [Violation] Added non-passive event listener to a scroll-blocking 'mousewheel' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
    [Violation] Forced reflow while executing JavaScript took 47ms
    Blink deferred a task in order to make scrolling smoother. Your timer and network should take less than 50ms to run to avoid this. Please see https://developers.google.com/web/tools/chrome-devtools/profile/evaluate-performance/rail and https://crbug.com/574343#c40

    None of those sound related to this issue.

    I then moved the fields one-by-one, and all was right again.

    Since I’ve got two different ways to deal with this, I can live with using those workarounds and don’t expect this to be addressed in the near future. But since I had not seen it reported here, I thought I should mention it.

    Thanks for taking a look at this Derek, I appreciate it.

    dgtlmkt
    26th October, 2017 at 2:16pm

You must be signed in to comment on a bug report.

ExpressionEngine News

#eecms, #events, #releases