-
-
Notifications
You must be signed in to change notification settings - Fork 358
Update DataTableComponent.php #533
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
Conversation
When updates composer all the tables shows this error, just needs to add this property to the Main DataTableComponent to solve it TypeError count(): Argument #1 ($value) must be of type Countable|array, null given
That property was removed yesterday to fix bulk actions. I currently see no errors with bulk actions using either the array or method. |
@cobogt where does the error occur in your code? Could you show us an example? |
`<?php namespace App\Http\Livewire; use App\Models\Libro; class ListaLibros extends DataTableComponent
}` |
@cobogt maybe you have published some asset like views? in that case they have not been updated with the last version in some places the old code used:
and it has been updated with
the latter allows the component to pass bulk actions both by property and by function (through the |
I am experiencing this issue too, since update 1.19.3. It breaks all my laravel livewire tables. This is the blade: <x-livewire-tables::uikit.table.heading
:sortingEnabled="$sortingEnabled"
:sortable="$column->isSortable()"
:column="$column->column()"
:direction="$column->column() ? $sorts[$column->column()] ?? null : null"
:text="$column->text() ?? ''"
:class="$column->class() ?? ''"
:customAttributes="$column->attributes()"
/> I am using a custom theme for the tables, when I switch back to an original theme (with the vendor views published again) it works. Two things here:
Please create a new version with changes that make it work backwards compatible! |
@dejury this was a mistake that did not got catched by tests, I'm really sorry about that I'm opening a PR to fix this breaking change would you mind to make a test for me? just to be sure to fix your problem? just edit and add this at line 224, after public function render()
{
return view('livewire-tables::'.config('livewire-tables.theme').'.datatable')
->with([
'columns' => $this->columns(),
'rowView' => $this->rowView(),
'filtersView' => $this->filtersView(),
'customFilters' => $this->filters(),
'rows' => $this->rows,
'modalsView' => $this->modalsView(),
'bulkActions' => $this->bulkActions // <<--- add this one
]);
} tests seems to work, but coverage isn't 100% so it would be good to have a double check first |
@fabio-ivona No worries about the mistake, everybody makes them ;) I will give it a try, one moment! |
@fabio-ivona I can confirm this fixes the issue! |
Ok I'm opening a PR right now 😉 |
here's the PR #535 @rappasoft let me know if you need support for this |
I suppose this PR can be closed then, moving to #535 |
When updates composer all the tables shows this error, just needs to add this property to the Main DataTableComponent to solve it
TypeError
count(): Argument #1 ($value) must be of type Countable|array, null given
All Submissions:
New Feature Submissions:
Changes to Core Features: