• Resolved gewagner

    (@gewagner)


    In version 1.75 of Otter Blocks, you could easily examine a section block or section column block and adjust both the padding (left, right, top, bottom) and margin values. If desired, you could link the values together and then adjust them as a group.

    In version 2.0/2.0.1, you cannot see either the padding or margin values stored in the database prior to the upgrade.

    Both the padding and margin values show that they are linked which was not the case prior to the upgrade. If you unlink either the padding or margin values, you still cannot see the values stored in the database.

    This is misleading and makes you think that the padding and margin values were lost during the upgrade and might cause you to attempt to recreate them. Fortunately they were not lost and you can see them if you revert to version 1.75.

    Please update Otter Blocks to show the correct padding and margin values. Thanks in advance.

    P.S. I did not show a link to a Website since I reverted to version 1.75 everywhere.

Viewing 9 replies - 1 through 9 (of 9 total)
  • I have the same issue with all of my sites running on Neve theme.
    When I switched to v2.0.0, I didn’t notice that padding/margin problem.

    Every section + section column of each page I edit has now 20px padding and 20px margins on every breakpoint (desktop / tablet / mobile).
    It is really a pain to get back to previous layout now 🙁

    Plugin Author Hardeep Asrani

    (@hardeepasrani)

    @mrmarket62 @gewagner Would it be possible for you to tell us what the padding/margin was before the update for your pages? Was it empty?

    Block Editor requires a weird migration when you make any major change to the code of blocks but the margin/padding should stay intact even after the update. We noticed an issue in one case where it was set to null (not 0 but empty) so was it the same case on your side?

    Thread Starter gewagner

    (@gewagner)

    Hi Hardeep,

    The fixes necessary are in class-advanced-column-css.php and class-advanced-columns-css.php.

    Both classes have a function named merge_old_attributes. In that function there is an attempt to set the padding as well as an attempt to set the margins using simple if/else statements (in both cases).

    Neither attempt satisfies all of the possible (data) conditions. I have some crude code that fixes most of the problems, but I need to refine it further before sharing it.

    When I run my code the values for both padding and margins can be seen in the block editor and are now correct (except for a few odd conditions I am working on).

    I hope this helps and I will share more as soon as possible.

    Hello Hardeep,

    Yes, the margin values on my sections / section columns were empty before update.

    The padding is often set on my elements, and values are visible in the editor column. So it seems that when a value is explicitely given before (in v1.7.5), it is ok with v2.0.1.

    Thank you both for your help!

    Plugin Author Hardeep Asrani

    (@hardeepasrani)

    @mrmarket62 @gewagner The code is also in the JS side. We check for true/false and we didn’t take into account of zero values which is being counted as false. We will fix it in the next version, sorry for the inconvience caused.

    Thread Starter gewagner

    (@gewagner)

    I am concerned about any solution that is not backwards compatible. The data that determines the setting of padding and margins is not always consistent so simple if/else statements like those found in class-advanced-column-css.php and class-advanced-columns-css.php will not suffice no matter what happens on the JS side.

    I have code that replaces the current if/else statements with other more complex if/else statements that account for every data condition I have encountered on a fairly complex page.

    If you would like a copy of that code, which includes diagnostic logging, just let me know how to share it with you.

    Plugin Author Hardeep Asrani

    (@hardeepasrani)

    Hey @gewagner,

    Sure, that will be great. You can send a link to your code here or you are also welcome to create a pull request here: https://github.com/Codeinwp/otter-blocks

    Thread Starter gewagner

    (@gewagner)

    Hi Hardeep.

    I created a draft pull request that references two files in my github repository. Both contain changes to how padding and margins are handled based on the data that was created by Otter Blocks since December 01, 2021. Both also log messages for purposes of understanding the data.

    Since git and github were only gaining traction right before I retired, my knowledge of both is limited.

    Should you have any problems accessing these two files, please let me know.

    Plugin Author Hardeep Asrani

    (@hardeepasrani)

    Sure, thanks @gewagner. I’ll review and run tests to make sure it works and we can communicate on Github if needed.

    Thank you for your contribution!

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Version 2.0/2.0.1 Hide Padding/Margin Values’ is closed to new replies.