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

API Deprecate Versions() having parameter #425

Merged

Conversation

emteknetnz
Copy link
Member

Issue #417

Currently this parameter is used and if called could cause a hard error since the having() method doesn't exist on DataList

I'm not even sure why this paramater ever existed since I'm not sure how it could even be used in this context since you're calling DataList::get() and then passing through the $filter, $sort, $limit and $join paramaters ... though there doesn't seem like there's anyway to even use having since it's not creating a select SQL statement with an aggregate function like count() in it

Seems best to just prevent it from even attempting to call the non-existant DataList::having() and deprecate it

@emteknetnz emteknetnz changed the title API Deprecate Versioned() having parameter API Deprecate Versions() having parameter Nov 3, 2023
@emteknetnz emteknetnz force-pushed the pulls/2.1/deprecate-having branch from 151353a to 44d071d Compare November 3, 2023 01:24
@GuySartorelli
Copy link
Member

This wasn't one of the options discussed in refinement. Why not implement having on datalist, or use alterDataQuery to call having on the underlying DataQuery?

@emteknetnz
Copy link
Member Author

emteknetnz commented Nov 5, 2023

Having a better look at this now seems like this param on Versions() that shouldn't have been there in the first place, so it doesn't make sense IMO to do work to support it

Copy link
Member

@GuySartorelli GuySartorelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to target 2. We don't deprecate API in patch releases.

Not super happy with this approach but it's an improvement on what we had, since it's not throwing an error any time someone tries to use the parameter now - so I'll be okay with it when it's targetting the 2 branch.

@emteknetnz emteknetnz changed the base branch from 2.1 to 2 November 5, 2023 22:23
@emteknetnz emteknetnz force-pushed the pulls/2.1/deprecate-having branch from 44d071d to 5e245df Compare November 5, 2023 22:24
@emteknetnz
Copy link
Member Author

@GuySartorelli done

@emteknetnz emteknetnz force-pushed the pulls/2.1/deprecate-having branch from 5e245df to 4d38781 Compare November 5, 2023 22:34
Copy link
Member

@GuySartorelli GuySartorelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@GuySartorelli GuySartorelli merged commit cccdb23 into silverstripe:2 Nov 5, 2023
9 checks passed
@GuySartorelli GuySartorelli deleted the pulls/2.1/deprecate-having branch November 5, 2023 23:46
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

Successfully merging this pull request may close these issues.

2 participants