Closed (fixed)
Project:
Diff
Version:
8.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Task
Assigned:
Reporter:
Created:
21 Sep 2016 at 16:34 UTC
Updated:
13 Oct 2016 at 14:44 UTC
Jump to comment: Most recent, Most recent file
I don't like this key shifting for +1. And then i realised in RevisionOverviewForm, we are loading count($vids)-1 twice because we just pass in the previous revision id and then load it deep inside summary(). You try to delegate loading, but still need to maintain conditions if $key isn't existing. That's bad delegation. If it's the last revision, just don't pass in a second revision(_id) at all. But i think we should switch $previous_revision_id with $previous_revision and load early. Small API change although beta, but IMHO mostly internal.
Improve getRevisionDescription to avoid this bad delegation.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | interdiff-2804021-7-9.txt | 3.77 KB | tbonomelli |
| #9 | improve_getrevisiondescription-2804021-9.patch | 6.05 KB | tbonomelli |
Comments
Comment #2
miro_dietikerCritical because API change.
Comment #3
johnchqueAdded related issue.
Comment #4
tbonomelli commentedLoaded the previous_revision early and passed the previous_revision instead of the previous_revision_id.
Comment #5
toncic commentedLooks good for me just little space.
Space between if and '(', .
Comment #6
johnchquewe might want to set $previous_revisions as optional?
Comment #7
tbonomelli commentedMade
$previous_revisionoptional in bothgetRevisionDescription()andsummary().Also removed an unneeded space.
Comment #8
tduong commentedMore feedbacks :P
Add
\Drupal\Core\Entity\ContentEntityInterfaceas @param type.If you add NULL, then you need to update the docblock as well, specifying that this param is optional and defaults to NULL.
For both params, add
ContentEntityInterfaceas type hints.You need to declare
$previous_revision = NULL;before the if check, then you can remove the else block.Add same param type mentioned above.
Add the type hints like above.
Comment #9
tbonomelli commentedAdded the @Param types and type hints. Also changed
$previous_revisionto optional in functionbuildRevision().Removed the else block and declared
$previous_revision = NULLbefore the if statement.Comment #10
tduong commentedLooks fine :)
Comment #12
miro_dietikerYes, i like. Committed.