Various Issues in Repeater Block with WooCommerce Sources

When adding a repeater block, there are certain conditions where selecting most of the WooCommerce dynamic data sources aren’t working. You can select the data source, but afterwards, the repeater will not accept a block to be nested within it.
It only seems to work when you add the repeater, select the data source, then select a product for the dynamic preview. After setting the dynamic preview, it will function as normal, allowing you to nest a block within it.

Step-by-step reproduction instructions:

  1. Open the Post Editor/Site Editor
  2. Either create a page/post/template, or use an existing one
  3. Add a repeater block
  4. Select a WooCommerce data source (Cart items seems to function correctly, any others don’t)
  5. Begin to notice errors. The repeater is expected to have a button to add a block, but it doesn’t
  6. Try adding an image block, then nesting it under the repeater. The repeater refuses it.
  7. Try wrapping the image block in a repeater (right click on image > Wrap > Repeater)
  8. Select the image and observe error where there is no inspector panel for the image block.
  9. Delete all of this to try another method
  10. Add a new repeater, setting the source to cart items.
  11. Nest an image in the repeater
  12. Switch the repeater source to Woo Gallery
  13. Try setting the image to a dynamic source and observe errors. The dynamic source options listed are for cart items, not for Woo Gallery.
  14. Delete all of this to try the only working method
  15. Add a repeater
  16. Set the source to Woo Gallery
  17. Set a dynamic preview. If one is already set, remove it and reset it.
  18. The repeater will now accept an image block. The image block will now have the correct dynamic source options.

Screenshots, screen recording, code snippet

Environment info

  • WordPress version: 6.2.2
  • Cwicly Plugin version: 1.2.9.8.3
    PHP 8.1.21

Hi @ChickenHacker,

Thank you for taking the time to report and provide a screencast of this issue!

I have been able to reproduce this behaviour on my end, and can confirm it is a bug.

It appears that the main problem arises when setting the dynamic preview before adding the Repeater block, leading to improper updating and data reception by the repeater.

We’ll be sure to find a fix for this as soon as possible.

Apologies for the inconvenience.

Hello @ChickenHacker,

Thanks for the report.

The issues you were experiencing with Repeater context not updating for WooCommerce sources should be fixed in 1.2.9.9.1.

If you still encounter trouble with this, I’d be grateful if you could let me know by replying to this thread.

Cheers,

1 Like