Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with filter in Laravel 10.40 #1321

Closed
marineusde opened this issue Jan 9, 2024 · 11 comments
Closed

Problem with filter in Laravel 10.40 #1321

marineusde opened this issue Jan 9, 2024 · 11 comments

Comments

@marineusde
Copy link
Contributor

Have you searched through other issues to see if your problem is already reported or has been fixed?

Yes, I did not find it.

Did you read the documentation?

Yes, I did not find it.

Have you tried to publish the views?

Yes - I didn't work.

Is there an error in the console?

htmlspecialchars(): Argument #1 ($string) must be of type string, array given

PHP Version

8.2.7

PowerGrid

5.1.18

Laravel

10.40

Livewire

3.3.5

Alpine JS

No response

Theme

Bootstrap

Describe the bug.

Upgrade laravel/laravel 10.39 to 10.40 with composer

To Reproduce...

Just insert a filter in the table:

public function filters(): array
{
    return [
        Filter::boolean('is_active', $this->tableName . '.is_active')
            ->label('Ja', 'Nein')
    ];
}

Extra information

Don't know if its a problem in the powergrid project, maybe just an information to others :)
@edwinheij
Copy link
Contributor

edwinheij commented Jan 9, 2024

confirmed

I tried to use:

{{  (new \Illuminate\View\ComponentAttributeBag($defaultAttributes['inputAttributes']))->toHtml() }}

That solved the error, but won't filter anymore (JS error)

@marineusde
Copy link
Contributor Author

marineusde commented Jan 9, 2024

I fixed it in the file "components/frameworks/bootstrap5/filters/input-text.blade.php" replacing:

{{ $defaultAttributes['inputAttributes'] }}

with:

@foreach ($defaultAttributes['inputAttributes'] as $key => $value)
   {{ $key }}="{!! $value !!}"
@endforeach

edit: or maybe better with the code of @edwinheij replaced with "{!! !!}" instead of "{{ }}":

{!! (new \Illuminate\View\ComponentAttributeBag($defaultAttributes['inputAttributes']))->toHtml() !!}

The filter works, but I dont know if its the right way. If @luanfreitasdev say its ok, I can do a merge request and replace it in all filter-blade-files tomorrow.

@luanfreitasdev
Copy link
Collaborator

Hello!. This breaks in Laravel 10.40, but this version has been removed from Laravel releases, let's wait

image


image

@luanfreitasdev
Copy link
Collaborator

laravel/framework#49524

@JhonArroyo
Copy link

Class "OpenSpout\Writer\XLSX\Options" not found.
issue

@shakeel2717
Copy link

Hi, i'm also facing this issue, i'm still trying to fixing it since yesterday, then after spend lot's of time, i figured out,that when i use filter, i got this error
htmlspecialchars(): Argument #1 ($string) must be of type string, array given

but when i comment all filters, then the table worked perfectly,, but without filter table is not valueable

is there any permanent solution you found, please share it with me.

Thank you so much

@marineusde
Copy link
Contributor Author

Hi, i'm also facing this issue, i'm still trying to fixing it since yesterday, then after spend lot's of time, i figured out,that when i use filter, i got this error htmlspecialchars(): Argument #1 ($string) must be of type string, array given

but when i comment all filters, then the table worked perfectly,, but without filter table is not valueable

is there any permanent solution you found, please share it with me.

Thank you so much

@luanfreitasdev removed the "buggy feature" in laravel 10.40 and its merged into the main branch already. 👍 We have to wait if Laravel 10.41 will be released and use laravel 10.39 now.

@luanfreitasdev
Copy link
Collaborator

Probably the best solution would be to return the Laravel version to lower than 10.39 and wait for the version > 10.40 that fixes this problem

@shakeel2717
Copy link

Probably the best solution would be to return the Laravel version to lower than 10.39 and wait for the version > 10.40 that fixes this problem

Thank you So Much, it's worked now.. Thank you SO Much <3

@marineusde
Copy link
Contributor Author

Laravel 10.41 is released and the bug is fixed 👍

@edwinheij
Copy link
Contributor

Laravel 10.41 is released and the bug is fixed 👍

Thanks for the tip. Missed the release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants