[BUG]? Some components do not accept new design changes

Description:

After updating to cwicly 1.4.2 some components have stopped responding to any and all changes from the Design panel I attempt to apply to them. This happens regardless of the property (border radius, opacity, margin…) and regardless of whether I apply those changes through tailwind or not.

Interestingly enough, the changes seem to get applied in the cwicly editor at first, but when I reload the page and click onto the component instance they revert back to the last configuration. And the changes are also not reflected in the frontend.

I have noticed that sometimes when I reload the cwicly editor the component does not even render, instead showing the “this component has corrupted content” message (don’t quite remember the wording right now).

All other components work fine and update on the frontend/backend as expected, so it’s just this one component that seems to be corrupted. Unfortunately, I cannot identify the root cause or recognise a pattern to fix the component.

Has anybody faced a similar issue?

Step-by-step reproduction instructions:

I cannot recognise a pattern in my broken component and since all other components work fine, I don’t see how anyone could replicate this issue.

Environment info

  • WordPress version: 6.6.2
  • Cwicly Plugin version: 1.4.2 & 1.4.4 (updating to 1.4.4 didn’t help)

Hi @marc,

We have seen similar behaviour from time to time and there can be different causes.

In order to isolate the issue, having more context about what the component is and how you have set it up will likely be required.

Hi @StrangeTech ,

thanks for reaching out! It’s good to hear that you found ways to fix this issue in the past.

The component is a simple reusable lightbox image container that my client is already using in multiple blog posts. This is how I set it up:

It contains a div block with its tag set to figure. Inside the figure there’s an img, a paragraph block with its tag set to figcaption and an icon wrapped in a div. It has a couple basic properties like img src, caption and so on.

There are also two style variants, each slightly adjusting either margin or border-radius.

If you need any further info, I’ll be happy to share more details. Thanks again for taking the time, really appreciate it :pray:

Update:

The culprit was the img block. I don’t know what exactly about the img block was causing the component to break, but at one point I got the following error message in the dev console:

Block validation: Block validation failed for cwicly/image (Object).

Content generated by 2. save function:

<a class="cc-lightbox" href="{component=image=HANqn}"><img class="{gclv=true} object-cover w-full max-h-96 lg:max-h-144 {gcl} cc-img" src="{component=image=HANqn}"/></a>

Content retrieved from post body:

<a class="cc-lightbox" href="{component=image=HANqn}"><img class="{aclv=true}{gclv} object-cover w-full max-h-96 lg:max-h-144 {gcl} cc-img" src="{component=image=HANqn}"/></a>

So it seems that some class on the <img> tag (not the one I assigned in the cwicly editor) was being saved/retrieved incorrectly.

The “solution” was to

  1. delete the img block entirely
  2. save the page
  3. reload the page
  4. create a new img block
  5. reassign all classes I previously defined on the original img block
  6. Save the page
  7. Regenerate HTML, CSS and so on

Hopefully this can be useful to someone in the future :slight_smile:

@Louis does this look more like a bug to you or like a potential incorrect setup on my part?

2 Likes

I have also encountered this intermittent bug with components. There is certainly an issue of some sort there

1 Like

Thanks for confirming @hopscotch!