silverstripe / silverstripe-assets

Silverstripe Assets component
BSD 3-Clause "New" or "Revised" License
9 stars 65 forks source link

Don't make query if not needed #558

Closed lekoala closed 11 months ago

lekoala commented 1 year ago

setByIDList will make a query even though there are no DBHTMLText for this DataObject

Checking the presence of these fields allow to return early and prevent the needless query

Fixes https://github.com/silverstripe/silverstripe-assets/issues/557

lekoala commented 12 months ago

@michalkleiner any other wishes for this PR ?

GuySartorelli commented 12 months ago

Arguably this is an enhancement and shouldn't be targeting CMS 4 - but given the very low risk of regression it's probably fine. I have no problem with this change, feel free to merge

lekoala commented 11 months ago

@GuySartorelli do you also apply this to the ss5 version or do i need to make a pr for that as well?

GuySartorelli commented 11 months ago

@lekoala it'll get merged up, eventually. We're working on getting merge ups to be automated but for now they're just done ad hoc. If you need this immediately let me know and I'll make a point to do merge ups sooner rather than later.

lekoala commented 11 months ago

@GuySartorelli i'm in the upgrade process to ss5 for my main client and that should go to production at the end of the summer, so if it's in a month or so that works for me :-)