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

Silverstripe 5 Incompatibilities #4

Closed
dcentrica opened this issue Nov 27, 2023 · 4 comments
Closed

Silverstripe 5 Incompatibilities #4

dcentrica opened this issue Nov 27, 2023 · 4 comments

Comments

@dcentrica
Copy link

I've been using this module for a couple of months and I love it. Don't know why it's needed (its functionality should be in core), anyway.

Silverstripe 5.1
PHP 8.2 (strict mode)
Alpine Linux (Docker)

Basically, most of the methods declared in SearchFilterArrayList are incompatible with ArrayList, here's an example:

PHP Fatal error:  Declaration of Signify\SearchFilterArrayList\SearchFilterableArrayList::createSearchFilter(string $filter, $value) must be compatible with SilverStripe\ORM\ArrayList::createSearchFilter($filter, $value)

I've fixed a few, but each time I run dev/build there are more to fix. AFAICT, the fix is to add typehinting and return types where they occur in ArrayList.

dcentrica added a commit to dcentrica/silverstripe-searchfilter-arraylist that referenced this issue Nov 27, 2023
@sig-steve
Copy link
Contributor

Hi, I'm glad you like it, and I'll have a look at #5 shortly.

My understanding was that most, if not all, of the functionality of this module was going to be incorporated into Silverstripe CMS, probably in 5.1.0. See silverstripe/silverstripe-framework#10925; it has been merged, but I don't know whether it is included in 5.1.0 or not.

You may potentially not even need this module any more.

@sig-steve
Copy link
Contributor

Ah, see this comment. @GuySartorelli wrote both this module, and the changes in silverstripe/silverstripe-framework#10925!

@GuySartorelli
Copy link
Contributor

GuySartorelli commented Nov 28, 2023

Yup! This functionality is available in core for silverstripe/framework 5.1.0 - so the module incompatibility is your cue to remove the module from your project as part of the upgrade to 5.1 and just use ArrayList directly 🥳

It's probably worth also checking the changelogs since there are some nuances to the implementation in core (e.g. default case sensitivity)

@dcentrica
Copy link
Author

Cheers all!

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

3 participants