Problem/Motivation
In #2924724: Add an API to create a new revision correctly handling multilingual pending revisions we introduced a new API to instantiate new revisions handling translations properly. The logic was partly borrowed from the node revision translation form logic. However this logic is still there when it could now rely on the new API.
Proposed resolution
Replace the old code with new API.
Remaining tasks
- Validate the proposed solution
Write a patch- Reviews
User interface changes
None
API changes
None
Data model changes
None
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | node-revision_revert-2939107-2.patch | 2.73 KB | plach |
Comments
Comment #2
plachComment #3
plachComment #4
wim leersFrom 18 LoC to 3? Yes, please!
Just one question:
Why was this not necessary before?
Comment #5
plachBecause the new code explicitly checks whether translation is enabled before applying the multilingual logic (optimization), while the previous one was just checking whether the entity was translated, which of course can only happen if translation was enabled before :)
Comment #6
wim leersComment #9
gábor hojtsySuperb, thanks, much cleaner!