spicywebau / craft-neo

A Matrix-like field type for Craft CMS that uses existing fields
Other
402 stars 63 forks source link

Invalid field layout ID: 319 (Changing a field in one layout block, changes the other) #862

Open JonnyBR12 opened 7 months ago

JonnyBR12 commented 7 months ago

Bug Description

When visiting an entry that contains a Neo field, we're getting an internal server error which, when in dev mode, shows:

Invalid field layout ID: 319 in /home/XXXXXX/public_html/_stage/vendor/spicyweb/craft-neo/src/assets/InputAsset.php at line 215– [yii\base\Component::call](https://www.yiiframework.com/doc-2.0/yii-base-component.html#call()-detail)('getFieldLayout', [])

When disabling Neo, the site works as expected. Can't think of anything that's updated or been changed since yesterday that could have caused this. Have you seen this before? Any help would be awesome.

Steps to reproduce

  1. Create an entry with a Neo field
  2. Create new entry
  3. Invalid field layout ID: 319 (or internal server error when live)

Expected behaviour

We'd expect the Neo field to load successfully with all blocks editable as always.

Neo version

4.0.6

Craft CMS version

4.8.1

What is the affected Neo field's propagation method?

No response

Does this issue involve templating, and if so, is eager-loading used?

This is not a templating issue

JonnyBR12 commented 7 months ago

This morning, we noticed that updating one Neo block changed the fields of another which was unrelated. We then deleted one of the Neo and tried to recreate which is when we got the internal server errors.

JonnyBR12 commented 6 months ago

Just to update on this, we've rolled the site back before this issue and it all comes down to two blocks created in Neo.

To try and explain, we had a block 'Featured Cars' with a couple of text fields and a textarea in it. We cloned that and renamed it 'New Car Models'. When we then change a field in either, the field changed in the other block too. Deleting either of these results in internal server error.

To replicate:

  1. Create a block with a couple of fields in
  2. Clone that block
  3. Change a field in either and they both change
  4. Deleting either of these fields now result in an internal server error with 'Invalid field layout ID'
ttempleton commented 6 months ago

Thanks for reporting this - I can't reproduce this error or the described behaviour, but I have just released 4.0.7 which fixes some other buggy behaviour affecting cloned block types which I'm hoping also fixes this. Could you please upgrade to 4.0.7 and let me know if that resolves your issue?

JonnyBR12 commented 6 months ago

Thanks for getting back to me on this. I'm back in on Tuesday, so we'll upgrade to 4.0.7 and report back.