Blocks delete themselves in Product by Category page

Description:

I am using the Product by Category page, but some elements that I add, after saving after making some changes, randomly deletes themselves. On the editor, the elements are still active but gone when I refresh, and the live site after saving changes in the editor doesn’t display the elements.

Step-by-step reproduction instructions:

  1. Open the Post Editor/Site Editor
  2. Install WooCommerce
  3. Add some product categories
  4. Add a product within one of those categories
  5. Go into the Cwicly themer and click on the “Products by Category” template
  6. Add a new Query Block and a Query Template
  7. Open the query editor and set it to “Products”
  8. Add a div into the query template
  9. Add an image and paragraph to the div
  10. Set the image to dynamic and set it to WordPress > Featured Image
  11. Set the paragraph to dynamic and set it to WordPress > Post Title
  12. Make a few random changes and save the page, checking the live site after each save to check if the bug has occurred for you. Repeat this process a few times if not and eventually, you should see the bug occur.

Screenshots, screen recording, code snippet

Environment info

  • WordPress version: 6.2
  • Cwicly Plugin version: 1.2.9
  • Cwicly Theme version: 1.0.3

Hello @ItzJosh241,

Thanks for the report.
I’m sorry to see that you’re experiencing this highly unusual issue.

Reading through your post, it isn’t clear to me if the blocks disappear both on the backend and frontend. Could you possibly clear that up?

I tried reproducing this error following your steps (thank you), without success: Clothing – cwiclydemo

Can you see if you can reproduce it yourself? (auto-login): https://app.instawp.io/wordpress-auto-login?site=$2y$10$KTrgCcdEnYN89Gjoof6Bq.TUXkrfeeMxCRRUjxVv5HrI3w26QGyni

Thanks in advance.

Hey Louis,

Yeah, so basically, the blocks do also disappear on the backend when refreshing the browser on the backend tab.

I can attempt to reproduce it on the backend now.

Hi Louis,

That’s odd because I can’t seem to reproduce the bug using the backend on the Cwicly demo link you sent. I am going to then assume that it could be a problem with something on my end, such as hosting or something similar.

Hi @ItzJosh241,

Thanks for checking the demo version out.
When it happens on your installation, can you possibly keep the editor page open and see if there are any errors in the browser console that might be preventing it from saving properly?

Thanks in advance.

Hello Louis,

I can most definitely do that now and see if I can spot any errors in the console. I’ll get back to you as soon as possible.

Hello Louis,

Thank you for being patient and bearing with me.

I have done it again, and had the same error again where the blocks have removed themselves, and these are the errors within the console which I think may be related to the issue:

Hi @Louis ,

Those logs there aren’t related to the issue. I have checked the “Network” tab of the browser inspector and no errors are shown there either.

Can I allow you to access the backend to see if you are able to spot the problem?

Thanks in advance!

Hello @ItzJosh241,

Thanks for the screenshots.
Indeed, what you’re experiencing could be linked to them.

It would be great for me to check this out on the backend if possible, thanks. I’d be grateful if you can send the details to support@cwicly.com

Thanks in advance.

Hello @Louis ,

I will be able to do that for you in a bit.

I have, at the minute, found a workaround for the issue which involves me changing something, changing it back and then saving the page again when blocks are randomly deleted and that is a temporary fix for now.

Hello @Louis ,

I have sent the details over by email for a staging version I created to avoid the loss of content on the actual website.

1 Like

Hello @ItzJosh241,

Thank you very much for the access.

I can confirm there is an issue when editing the Product by Category template, but this seems to be related to WooCommerce and not Cwicly.
You can replicate the exact behaviour with a clean installation without Cwicly installed.

Basically, the template is duplicated on save (Taxonomy Product Cat x + 1 and so on every time you save…) and the base template is reset.
Not sure why this is happening or if the WooCommerce team is aware of the situation.

I’d recommend using a custom template and applying conditions to target product archives instead.

Hi @ItzJosh241,

The same type of issue can be found here and unfortunately isn’t related to Cwicly: Custom taxonomy and Query editor error - #6 by Araminta

Hello @Louis ,

Thanks so much for checking this for me. I really appreciate your help! I will indeed use a custom template instead of using the default template.

1 Like