Problem/Motivation

As recently as 8.x-1.17 method filterValidItemIds was in ContentEntity.php and was public. We were calling this in custom code that extends the external_entitites module.

Steps to reproduce

Proposed resolution

While remaining in ContentEntityTrackingManager, can filterValidItemIds become a public function? I'll attach a patch to do that.

Remaining tasks

Approve and merge patch

Comments

johne created an issue. See original summary.

johne’s picture

Here is that patch.

drunken monkey’s picture

Status: Active » Needs review
Issue tags: +Needs change record
StatusFileSize
new3.21 KB
new3.21 KB

Thanks for reporting this, and sorry it even happened! By rights, we probably shouldn’t have just removed a public method, and certainly not replaced it by a protected one. So, in addition to making it public, we might also want to bring back ContentEntity::filterValidItemIds() as a reference to the new one? (Maybe deprecating it, though?)

Also, as the method continues to be independent of the class instance, it should probably still be static, as it was before? Would also make it easier for you to call it, I think. (And calling it as an instance method would still be supported, though maybe reported as code smell.)
What would you say? (Also, feedback/opinions from others very welcome.)

Attached patch would implement both of the above changes, but not 100% sure yet. (Deprecation would also need a change record, of course, if we go that route.)

(BC should not be an issue, I think, as it’s highly unlikely that anyone inherits from ContentEntityTrackingManager and overrides filterValidItemIds(). Still, it’s probably technically a BC break.)

drunken monkey’s picture

Status: Needs review » Fixed
Issue tags: -Needs change record

Committed, with the deprecation. It’s pretty clear this is the clean thing to do, even though nobody seems to have noticed this for over a year (and three releases).
Thanks again for reporting this!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.