Follow-up to #2799597: Select theme for diff display
Problem/Motivation
if ($route_match->getRouteName() === 'diff.revisions_diff') {
Currently the negotiator theme for visual inline layout will only work with nodes due to the line above. Change it to be more flexible and work with other entity types too.
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #22 | make_theme_negotiator-2810267-22.patch | 922 bytes | johnchque |
| #17 | interdiff-2810267-15-17.txt | 1.33 KB | toncic |
| #17 | take_care_of_other-2810267-17.patch | 2.51 KB | toncic |
| #15 | interdiff-2810267-13-15.txt | 1.58 KB | toncic |
| #15 | take_care_of_other-2810267-15.patch | 2.36 KB | toncic |
Comments
Comment #2
toncic commentedComment #3
toncic commentedComment #4
berdirissue title should include what this is about (diff display theme). also, you can close the other issue (fixed)
Comment #5
toncic commentedComment #6
toncic commentedComment #7
toncic commentedAdding new function to check routeName.
Comment #9
toncic commentedForgot to add '/' on the begging and on the end of my regex.
Comment #10
miro_dietikerYou put some check into "checkRouteName" that is a function name that doesn't tell me anything about what it checks.
Better Outwourcing would be a method isDiffRoute() that checks both diff.revisions_diff route name and the regular expression match.
This check is the fastest. Start with this and in 99% of the cases all the other checks are not made.
Comment #11
toncic commentedDid changes from #10
Comment #12
miro_dietikerWrong indentation.
Typo
@return Should be boolean and not explain details.
The summary "Check diff route" is too short and doesn't explain what it means.
Comment #13
toncic commentedFixing indentation, typo and changed summary.
Comment #14
miro_dietikerThe summary needs to be one line.
See doc standard how to add more detail.
See coding standards:
bool (NOT "boolean" or "Boolean"). If only TRUE or only FALSE is a possible value, rather than either one being possible, use true or false instead of bool.
The integration test would be hard to test (dependency to entity module, other entity type, ...), but our unit test is easy to extend to trigger this case. We really need test coverage for bugs!
Comment #15
toncic commentedChanged summary and test coverage,
Comment #16
miro_dietikerNow the indentation is wrong in the comment.
The isDiffRoute covers two cases.
Your Unit test need to test both cases!
Comment #17
toncic commentedAdded new test case and fixing indentation.
Comment #19
miro_dietikerCommitted, thx.
Comment #20
johnchqueNoooo, I should make this comment first!
Space missing between "if" and "(".
Why don't we return FALSE anymore?
Comment #21
johnchqueComment #22
johnchqueI would like to see if this passes tests first.
Comment #24
miro_dietikerCommitted.