Problem/Motivation
Noticed when reviewing #3418442: Revisions should be filtered by language in the database query
In RevisionOverviewForm::buildForm we have some logic to get the previous revision and pass it to ::buildRevision which then passes it on to $this->entityComparison->getRevisionDescription (another unecessarily public method).
getRevisionDescription does nothing with $previous_revision so all of this is a waste.
Proposed resolution
Remove handling from buildForm
Remove param from buildRevision and pass NULL to getRevisionDescription
Potentially deprecate getRevisionDescription on the entityComparison service since it's only called from buildRevision and move it into the Form class. We can then remove the entityComprison service from the form as well.
Remaining tasks
User interface changes
N/A
API changes
See above
Data model changes
Issue fork diff-3568877
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
yusuf_khan commented@acbramley - Im Looking into this issue
Comment #3
yusuf_khan commentedPlease review the MR - https://git.drupalcode.org/project/diff/-/merge_requests/152
Comment #5
acbramley commentedThe parameters need to be removed from the methods. Please see the proposed resolution in the issue summary.
Comment #8
acbramley commentedComment #10
joseph.olstadComment #11
acbramley commentedComment #12
joseph.olstad11.4 next minor tests are failing. ah, I see, it's fixed in 2.x, merging 2.x into the MR
Comment #13
joseph.olstadComment #14
joseph.olstadMerging this will result in large conflicts with 2452523. If it was me calling the shots, I'd merge 2452523 first and then redo this merge request based on that instead.
I recommend postponing on #2452523: Offer a revisions tab for all entities , it's been 11 years now, everything else can wait IMHO!
Comment #15
joseph.olstadPostponed on #2452523: Offer a revisions tab for all entities
Comment #16
joseph.olstadThis issue is in direct conflict with 2452523. Adding related issue link.
Comment #17
acbramley commentedIt is not postponed on this issue. The conflict is exactly why we're getting this one in first.
Comment #19
joseph.olstadmarking this as fixed
Comment #21
yusuf_khan commented@maintainer can you please givr me contibution credit.
Comment #23
danflanagan8This was a pretty unpleasant surprise when I just updated from beta5 and discovered that the public method getRevisionDescription had disappeared from the diff.entity_comparison service. Luckily I have good test coverage for my project code that integrates with diff.
I know it's technically beta but I'm pretty sure that even then it's poor form to remove a public method from a service.