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

Passing callable classes to addColumn #2976

Closed
recursivetree opened this issue Mar 27, 2023 · 0 comments · Fixed by #2977
Closed

Passing callable classes to addColumn #2976

recursivetree opened this issue Mar 27, 2023 · 0 comments · Fixed by #2977

Comments

@recursivetree
Copy link
Contributor

Summary of problem or feature request

After upgrading our app to laravel-datatables 9.21 and above, you can't pass a class implementing __invoke() to addColumn. While this has never been supported according to the docs, it has worked until now.

In our project, we used this to share common columns across multiple tables.

Code snippet of problem

This is the context where the issue arises for us.
https://github.com/eveseat/web/blob/master/src/Http/DataTables/Character/Intel/Assets/DataTable.php#L120
https://github.com/eveseat/web/blob/master/src/Http/DataTables/Common/Intel/AbstractAssetDataTable.php#L95
https://github.com/eveseat/web/blob/master/src/Http/DataTables/Common/IColumn.php
https://github.com/eveseat/web/blob/master/src/Http/DataTables/Character/Intel/Assets/Columns/Owner.php

Commits introducing the problem

3e6846a
4f2db32

Instead of allowing everything that's callable, only Closures are passed through. It should be an easy fix to allow everything callable again.

System details

  • Operating System docker containers on mac os
  • PHP Version 8.1
  • Laravel Version 10
  • Laravel-Datatables Version >= 9.21
warlof pushed a commit to eveseat/web that referenced this issue Mar 28, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant