silverstripe / silverstripe-fulltextsearch

Adds external full text search engine support to Silverstripe
BSD 3-Clause "New" or "Revised" License
44 stars 83 forks source link

FIX Don't assume DataObject::canView always returns bool #306

Closed GuySartorelli closed 2 years ago

GuySartorelli commented 2 years ago

Fixes #304 See also silverstripe/silverstripe-elemental#951

Because there is no return value typehinting in DataObject::canView, the value returned from that method can be of any type. We must cast to boolean before returning the value to avoid possible errors with non-boolean return types.

GuySartorelli commented 2 years ago

@michalkleiner I avoid targetting specific versions because I have seen far too many PRs targetted for a specific version with 2+ comments afterward asking to retarget because it never got merged in.

Edit: That said, if I can have some assurance that that won't happen in this case I'm happy to retarget.

emteknetnz commented 2 years ago

@GuySartorelli I've re-targeted to 3.9 and released a patch version for you - 3.9.1