spicywebau / craft-batch-actions

A Craft CMS plugin for performing batch actions on Matrix and Neo blocks
MIT License
4 stars 3 forks source link

Wrong block parent #8

Closed yannkost closed 10 months ago

yannkost commented 10 months ago

Bug Description

When I copy multiple blocks/all blocks from one entry to another, then the first block of those blocks is considered the parent of all following blocks. After the paste action, I'm unable to save the entry, due to this error.

Steps to reproduce

  1. Open an entry with several neoblocks in the same field
  2. Select the checkbox of the batch-actions plugin to select all blocks and click on "Copy"
  3. Go to another entry and click "Paste"
  4. Click save, then see the validation error message

Expected behaviour

The blocks should have the right parent block and none, if there is no parent block. (In this case, most of the blocks do not have a parent block.)

I also want to mention, that the graphical representation of the blocks if working well. Also the version of the craft-neo extension is 4.0.0. I will try if I can reproducte the error after the last update to 4.0.1...

Batch Actions version

1.3.1

Craft CMS version

4.5.13

yannkost commented 10 months ago

Testet it also with the craft-neo v.4.0.1, but still the same error. The first of the copied blocks is consideret the parent of all other blocks.

image

ttempleton commented 10 months ago

Thanks for making the bug report - I believe this is related to https://github.com/spicywebau/craft-neo/issues/825 which I've just released Neo 4.0.2 to fix. Please let me know if 4.0.2 doesn't fix your issue, though.

yannkost commented 10 months ago

I can confirm that the version 4.0.2 of Neo fixed the issue. Thanks!

medoingthings commented 7 months ago

I seem to have the same issue. I just updated to Neo 4.1.2 and noticed that for one field, all the child blocks moved to the parent level. Even after removing them and adding them as new childs.

Not sure when this issue was introduced – I updated from 4.0.7.

When I resaved the field and tried again to properly add children, it seemed to work again, but I would have to delete and re-add all children blocks. Is there a way to fix this in a way that the error disappears for existing content?

parent-block-issue

ttempleton commented 7 months ago

@medoingthings If your Craft project does not use Preparse Field (which is known to cause the kind of issue shown in your screenshot, and we therefore list it as incompatible with Neo in our plugin compatibility documentation), please feel free to open a new Neo issue.

medoingthings commented 7 months ago

Thanks for the heads-up! The issue affected only a limited amount of entries, so I fixed them manually and moved on. No need for a new issue.