Needs work
Project:
Drupal core
Version:
main
Component:
comment.module
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
15 Oct 2015 at 16:49 UTC
Updated:
25 Apr 2022 at 20:12 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
andypostHere's a simple fix
Comment #3
andypostOtoh it makes sense to disable the plugin when no history modules enabled
Comment #4
andypostAnd here's a test
Comment #6
larowlanThank you, looks great
Comment #8
catchLooks good to me, and should go in during RC if possible, tagging for triage.
Comment #9
alexpottI think the
Drupal\comment\Plugin\views\field\NodeNewCommentsplugin also needs to be adding a dependency on the history module so that a view which depends on it is listed when uninstalling the history module. Doing this will break the new test :)Comment #10
alexpottDiscussed with catch and we agreed that this would be a nice bug to fix asap.
Comment #11
alexpottAlso @xjm is plus one too.
Comment #12
xjmFound the very similar issue that went in recently: #2591147: Filter criteria for views, option "Content is updated" - causes a SQL syntax error
Comment #13
xjmSorry, my point in #12 was that #2591147: Filter criteria for views, option "Content is updated" - causes a SQL syntax error and this issue are fixing the same bug in different places, so it makes me wonder whether there is a fix that will fix both rather than special-casing comment all over the place in history views plugins.
Comment #14
andyposttested manually imported view, it's removed after uninstall but not in test...
Comment #16
alexpottFixing the test - you need to rebuild the router after uninstall - that would happen if part of a regular request.
Comment #17
andypostThanx a lot!
Comment #18
larowlan+1
Comment #19
alexpottre #13 the fix in #2591147: Filter criteria for views, option "Content is updated" - causes a SQL syntax error is not really removing the comment dependency - it's just burying it behind some tricky to follow logic. The fix here makes the dependency on the history module of the NodeNewComments plugin explicit and therefore, I think this is the correct fix.
Quite how a user might discover that they get this additional functionality by installing the history module is another question that I have no idea how to answer.
Unfortunately we need an upgrade path because this is adding dependencies to views.
Comment #20
alexpottThe upgrade path can use the post update functionality and therefore use the Views and config entity APIs to fix all of this.
Comment #21
catchComment #22
xjmComment #24
mohit_aghera commentedUpdating patch for 8.1.x and 8.2.x. hence interdiff isn't attached.
Comment #27
mohit_aghera commentedDirectly updating 8.2.x patch first.
Comment #29
mohit_aghera commentedFixing typo for 8.2.x patch.
Comment #30
mohit_aghera commentedFixing errors for patch in 8.1.x branch.
Interdiff taken from #27 patch.
Comment #31
mohit_aghera commentedComment #34
KurtHiggins commentedThis bug is still present, I've updated the steps to reproduce issue to be more precise to triage the issue.
Comment #35
KurtHiggins commentedThe patch applies, the patch resolves this error by making the field not available unless the history module is enabled.
Comment #36
KurtHiggins commentedComment #37
yesct commentedupdating remaining tasks
I'm not sure if the "missing config dependencies" tag should be kept so that we know config dep changed, or if that tag means there is a todo to add missing config dep. so leaving the tag.
Comment #38
larowlanUpdate path is next step here
Comment #41
sean_e_dietrichWorking on this as part of DrupalCon Nashville!
Comment #42
sean_e_dietrichIssue still happening within the 8.6.x branch. Fixed issue with upgrade path using the suggestion of using hook_post_update_NAME.
Comment #51
lendudeNeeded a reroll, so did that.
Changed the update hook a bit, not convinced that turning on the history module and not removing the field is the right way to go here, but it is the least destructive, so let's go with that for now.
Added an upgrade path test, it doesn't check for the history module getting switched on because we don't have a dump where it's turned off and uninstalling it in the test does unexpected stuff to the view.
So just this for now.
Updated the tags a bit.
Comment #53
larowlanif we get this far, do we need to keep the batch running?
I.e should we set $sandbox['#finished'] = 1
edit: Yes, because we need the view's dependencies to be updated too
This is looking good to me, I'm not sure if we need an update path test to ensure the module is enabled, we already have the dependency test which is implicitly testing the update path.
We do however need to introduce the deprecation error this is introducing in the test