Closed philbarbato closed 3 years ago
Also experiencing this
Unfortunately I couldn't work around this without simply disabling Field Labels, adding what I needed to in Neo, and then re-enabling Field Labels.
Hope this will be fixed in a future version!
The second argument to craft\helpers\Db::idByUid()
being null
makes me think it's trying to apply changes to a label where the label's associated field doesn't exist... which definitely should not be happening, as labels should be deleted when their field is deleted.
@philbarbato or @aaronbushnell, in your database's fieldlabels
table, are there any labels with fieldId
s that represent nonexistent fields?
Mine all seem to be accounted for!
Oddly enough the value for $event->newValue
ended up being NULL
when I inspected the error further. This line: https://github.com/spicywebau/craft-fieldlabels/blob/master/src/Service.php
Even more strange was there was one time where a save on a Neo field did work and didn’t throw this error.
Is it possible there’s some kind of race condition happening that large Neo setups are more susceptible to?
@aaronbushnell I think something like that was happening. I was never able to reproduce the error, but I fixed a couple of bugs I found with Neo and Field Labels along the way, which I hope will fix this error too. Basically there was a lot of field layout and field label deletion/recreation going on, more details below:
fieldlabels
POST data, but it's under neo[fieldlabels]
for Neo field layouts. Field Labels then deletes any existing labels it didn't find in the POST data, which, in the Neo case, is all of them. This had no effect before the Neo field layout issue was fixed because the labels had already been deleted, but it did happen afterwards, so that was fixed in Field Labels 1.2.3.Please let me know if the error is gone after updating!
Thanks a ton, @ttempleton! I know this stuff is almost impossible to diagnose so really appreciate you taking a stab here.
When we update I’ll let you know if we continue to encounter errors here!
Description
Occasionally, when I make some changes to a Neo field with lots of blocks and several relabels, I get this error and I'm unable to save the changes to the field:
full stack trace
It doesn't seem to be triggered by the specific Neo block or field layout I was changing. The stack trace usually shows another field label. I was able to fix this once by updating Neo, but it feels like that was more of a "hit it with a hammer" fix than an actual fix. Since then, the problem has arisen again.
Steps to reproduce
Other information