Problem/Motivation
To support query logic changes in #3118464: Add support for "Maximum number allowed" revisions per content node translation and #3094354: Delete draft revisions safely, I'm proposing to refactor NodeRevisionDelete:getCandidatesRevisionsByNids() as NodeRevisionDelete:getCandidatesRevisionsByNid() to only accept a single node id so that the query logic found within NodeRevisionDelete:getCandidatesRevisionsByNids() and use a subquery to only find translated revisions that are older than the current translation version.
Proposed resolution
This solution relies upon patch from #3127258-4: Replace CandidateNodesForm::submitForm usage of getCandidatesRevisionsByNids to remove the only usage of NodeRevisionDelete:getCandidatesRevisionsByNids() with an array of node IDs. Once removed, we can refactor NodeRevisionDelete:getCandidatesRevisionsByNids() as NodeRevisionDelete:getCandidatesRevisionsByNid() to accept a single node id.
Remaining tasks
- Consensus
- Patch
- Feedback
User interface changes
None
API changes
Changes to NodeRevisionDelete interface and NodeRevisionDelete:getCandidatesRevisionsByNids().
Data model changes
None
Release notes snippet
TBD
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | node_revision_delete-refactor_getCandidatesRevisionsByNids-3127265-3.patch | 4.47 KB | jasonawant |
Comments
Comment #2
jasonawantadding related issue links, self-assigned to upload patch
Comment #3
jasonawantHere's a patch for review. This patch requires patch from #3127258-4: Replace CandidateNodesForm::submitForm usage of getCandidatesRevisionsByNids.
Comment #4
adriancidWhy we need to remove the use of the array as a parameter when we can make something like:
Comment #5
jasonawant@adriancid,
The query logic found within the current getCandidatesRevisionsByNids() method relies upon the array here
My attempt to to account for # of revisions per translation in #3118464-13: Add support for "Maximum number allowed" revisions per content node translation relies upon removing the provided nids array and change this query logic. So, to adjust the query logic in 3118464, I had to remove the only usage of the array in #3127258: Replace CandidateNodesForm::submitForm usage of getCandidatesRevisionsByNids and then remove it here in this issue.
Comment #6
adriancidHi @jasonawant thanks for your patches and for your time, I really appreciate the time you are putting on the module, unfortunately, I'm missing time on these days, I hope in the coming days I will have some hours to check all the patches. Thanks for your contributions.
Comment #7
jasonawantI totally understand; no worries.
Comment #8
adriancidClosing because the current development is being made in branch 2.x