Problem/Motivation
The Node entity has three revision-related fields:
- revision_uid
- revision_timestamp
- log
log is ambiguously named.
Similar CustomBlock has a log property.
Proposed resolution
log should be named revision_log.
Remaining tasks
User interface changes
API changes
| Comment | File | Size | Author |
|---|---|---|---|
| #29 | 248991-29-revision-log.patch | 29.85 KB | marco |
Comments
Comment #1
tstoecklerLet's see what breaks.
Comment #3
marco commentedComment #4
marco commentedComment #5
tstoeckler@marco: Are you still working on this?
Comment #6
marco commented@tstoeckler, yes, here's the patch.
Comment #8
marco commentedNew version:
Also note that I've made the {block_custom_revision}.revision_log column nullable so I've removed the @todo and the logic in CustomBlock::preSaveRevision().
I've removed the same logic from Node:: preSaveRevision() but the revision_log column was already nullable.
Comment #9
marco commentedComment #10
tstoecklerWow, @marco. Awesome work! I would have never gotten this patch green in only 2 tries. :-) Respect. And thanks!
I have a few minor remarks, but this is really close, I think. It would be awesome if you could finish this off?! :-)
Sure, let's do it! Nice find.
Wow, good catch!!! This means this needs manual testing, however. Tagging accordingly.
Thanks for making the description consistent with
Node. Yay!Same as above. Either leave the local variable
$logsas is, or rename it to$revision_logs. (Again$this->revisionLogsshould not be$this->revision_logs.)Checked that the
logfield on{node_revision}(not{node_field_revision}as the comment says is already'not null' => FALSE.If you want to rename the local variables as well (keeping them would have been fine as well) the local variable should be named
$revision_logs. Note that the member variable is named correctly. To be clear: The third hunk of the above excerpt should then read:$this->revisionLogs = $revision_logs;Since we're changing this already can you add a the between on and "revisions overview"? That might mean you would have to re-adjust the wrapping, though.
Again...
Again, this needs manual testing. Great job for finding this, though!
Comment #11
marco commentedHi @tstoeckler, thank you for your patience.
Here are a new version where I should have fixed your remarks, and an interdiff.
Comment #12
plachAwesome work, I manually tested this and it's working ok. Just one complain:
For consistency we should use the method call in both places. Moreover if these checks were needed to fix failing tests then we are good, otherwise we should update tests so they fail without those.
Comment #13
tstoecklerWell the condition is just moved from the if() condition. So I disagree on the need for additional test coverage here. The logic remains the same.
I agree that we should be using isNewRevision() (i.e. the method call) in both places for consistency.
Comment #14
marco commentedUpdated to use isNewRevision(). The checks were needed for the test to succeed.
Comment #15
plachCool, thanks
Comment #16
xjmReroll for #2247991: [May 27] Move all module code from …/lib/Drupal/… to …/src/… for PSR-4.
Comment #18
tstoecklerReroll after #2183231: Make ContentEntityDatabaseStorage generate static database schemas for content entities.
Comment #19
tstoecklerWhich reminds me that we should also now resolve the @todo there, that spawned this issue :-)
I consider that interdiff to be part of the merge, so straight back to RTBC :-)
Comment #22
tstoecklerWow, ContentEntityDatabaseStorage has quite some thorough test coverage these days... :-P
Comment #23
plachRTBC +1
Comment #25
marco commentedrerolled
Comment #26
plachThanks!
Comment #27
plachAdding to the beta target list as this change will have an impact on the generated schema.
Comment #28
catchPatch of the week, but unfortunately does not apply.
Comment #29
marco commentedReroll for #2138073: Remove module_load_include() call from NodeController::revisionOverview()
Comment #30
berdirRe-roll looks good.
Comment #31
catchThanks for the re-roll. Committed/pushed to 8.x, thanks!