whitecube / nova-flexible-content

Flexible Content & Repeater Fields for Laravel Nova
MIT License
788 stars 228 forks source link

Laravel 9.42.1 change of Dynamic Relation Resolver #419

Closed bashgeek closed 1 year ago

bashgeek commented 1 year ago

With todays update of Laravel to 9.42.1 it merged https://github.com/laravel/framework/pull/45122

This results in an error on our forms now:

Call to undefined method Whitecube\NovaFlexibleContent\Layouts\Layout::relationResolver() {"userId":1,"exception":"[object] (Error(code: 0): Call to undefined method Whitecube\\NovaFlexibleContent\\Layouts\\Layout::relationResolver() at vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php:544)
[stacktrace]
#0 vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php(452): Whitecube\\NovaFlexibleContent\\Layouts\\Layout->isRelation('note')
#1 vendor/whitecube/nova-flexible-content/src/Layouts/Layout.php(492): Whitecube\\NovaFlexibleContent\\Layouts\\Layout->getAttribute('note')
#2 vendor/laravel/framework/src/Illuminate/Collections/Arr.php(170): Whitecube\\NovaFlexibleContent\\Layouts\\Layout->offsetExists('note')
#3 vendor/laravel/framework/src/Illuminate/Collections/helpers.php(77): Illuminate\\Support\\Arr::exists(Object(Whitecube\\NovaFlexibleContent\\Layouts\\Layout), 'note')
#4 vendor/laravel/nova/src/Fields/Field.php(381): data_get(Object(Whitecube\\NovaFlexibleContent\\Layouts\\Layout), Array)
riccis-u2y commented 1 year ago

Any news or workaround? I'm facing the same issue

voidgraphics commented 1 year ago

@riccis-u2y We have no time to investigate currently, but we'll merge a PR that fixes this if one comes up.

LTKort commented 1 year ago

Since we forked your package & use it a lot, we opened a PR #420 (nice), that fixed the issue on our side

voidgraphics commented 1 year ago

I have tagged v1.0.6 with the fix from @LTKort, please give it a test and report back if possible

dinandmentink commented 1 year ago

Thanks for the quick response. Can confirm issue exists with v1.0.5 but fixed in v1.0.6.

BachirBichri commented 1 year ago

Hello i have the same issue with v0.2.13

ekandreas commented 1 year ago

How do we use this in Nova 3? We will never go v4 because of braking changes / new stack.

ekandreas commented 1 year ago

We patched the package via these instructions: https://downing.tech/posts/overriding-vendor-classes

voidgraphics commented 1 year ago

Tagged v0.2.14 with the fix for Nova 3.