You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @GromNaN, I believe #2578 was released in 4.0, and this is a bug with the behaviour. Once unset() is called for a field, it will bypass any getFieldAttribute() getters, and refresh() won't remove this unset state so it will always return null.
Edit: Just to note - we're only still on 4.0 because of #2703
Description:
Steps to reproduce
Two reproductions:
$model
$model->unset('field')
$model->refresh()
$model->field
will always be nullAnd secondly:
$model
$model->unset('field')
$model->save()
$model->field
will never call$model->getFieldAttribute()
and will always return null.(In the latter case, our
$model->getFieldAttribute()
would return an empty array if the value doesn't exist)Expected behaviour
The
Model::$unset
array should be cleared on a save/refresh, and it shouldn't prevent getters from being called.Actual behaviour
Model::$unset
persists until the value is set manually, preventing anygetXAttribute()
getters from being called and always returning null.The text was updated successfully, but these errors were encountered: