lara-zeus / bolt

form builder for your users, with so many use cases
https://larazeus.com/bolt
MIT License
183 stars 32 forks source link

[Bug]: Calling static trait method LaraZeus\Bolt\Concerns\Designer::ui is deprecated #331

Open eelco2k opened 11 hours ago

eelco2k commented 11 hours ago

What happened?

Calling static trait method LaraZeus\Bolt\Concerns\Designer::ui is deprecated, it should only be called on a class using the traitvendor/lara-zeus/bolt/src/Livewire/FillForms.php#51ErrorException

    {
        $getDesignerClass = $this->getBoltFormDesigner() ?? Designer::class;

        return $getDesignerClass::ui($this->zeusForm, $this->inline);
    }

    protected function getFormModel(): Form

it only happens when i enable barryvdh/laravel-debugbar.

How to reproduce the bug

open a form on the frontend side with barryvdh/laravel-debugbar enabled

Package Version

v3.0.68

PHP Version

8.3.12

Laravel Version

10.48.22

Which operating systems does with happen with?

macOS

Notes

No response

atmonshi commented 5 hours ago

do you have getBoltFormDesigner?

eelco2k commented 5 hours ago

is it only in the paid version? then no. i use free version.

atmonshi commented 5 hours ago

no, its available for the free. if not, then I am afraid its not reproducible for me! its working in the demo app. using php 8.3.12

atmonshi commented 5 hours ago

are overriding the form resources or any part of it? in the class FillForms confirm if the trait use Designer; exist

eelco2k commented 5 hours ago

have you also done: php artisan optimize
?

eelco2k commented 5 hours ago

as this caches config and routes

atmonshi commented 5 hours ago

artisan storage:link artisan migrate --force artisan optimize:clear artisan config:cache artisan route:cache artisan icons:cache artisan view:cache

eelco2k commented 5 hours ago

yep okay. i'm going to check if getBoltFormDesigner() exists..

eelco2k commented 4 hours ago

dd($this->getBoltFormDesigner());
returns "null"

eelco2k commented 4 hours ago

i'm not overriding anything. and the trait use Designer; exists in the FillForms.php

when i change it to this:

protected function getFormSchema(): array
    {

        $getDesignerClass = $this->getBoltFormDesigner() ?? $this;
        return $getDesignerClass::ui($this->zeusForm, $this->inline);
    }

i'm getting another error:

    LOG.error: Creation of dynamic property LaraZeus\Bolt\Livewire\FillForms::$placeholder-zeus-form-section is deprecated 
eelco2k commented 4 hours ago

APP_ENV=local and enabled APP_DEBUG=true with barryvdh/laravel-debugbar enabled.

also when i try to use:

 return (new class { use Designer; })::ui($this->zeusForm, $this->inline);

i get :

 Creation of dynamic property LaraZeus\Bolt\Livewire\FillForms::$placeholder-zeus-form-section is deprecated 
eelco2k commented 4 hours ago

the second error can be fixed to add Attribute like this:

#[\AllowDynamicProperties]
class FillForms extends Component implements Forms\Contracts\HasForms
eelco2k commented 4 hours ago

then everything works as expected even in other ENV with debugging enabled. Hope you can add these fixes soon :)

atmonshi commented 3 hours ago

bolt on "php": "^8.1", I cant provide breaking changes now :) but will do with v4 after filament v4 is available 👍