Closed (fixed)
Project:
Drupal core
Version:
8.6.x-dev
Component:
forum.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
12 Oct 2017 at 14:59 UTC
Updated:
6 Feb 2018 at 13:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
volegerComment #3
jibranHow can a clean up task be a major?
Comment #4
wim leersThanks so much, @voleger! And I'm sorry that this didn't receive the reviews it deserved :(
Great work here!
But, there's a problem with scope:
Please revert changes like these. They're out of scope.
And keep only changes like these.
That's what the issue title describes, that is the scope of this issue!
Comment #5
volegerThanks for the review, @Wim!
I just had rewritten a little bit more than needed, sorry =)
Your description more clear to me now, so here is updated patch. No interdiff file, because I rewrote that patch against 8.6.x core version.
Comment #6
wim leersThat's SO much better! So much simpler :) I wanted to RTBC, but found one things I wasn't sure about yet, and one nit:
Why this change?
Nit: we can chain all of this:
Comment #7
volegerComment #8
wim leersI'm confused. #7 doesn't address #6. It re-introduces out-of-scope changes?
EDIT: I was hoping to RTBC #5 when #6 was addressed!
Comment #9
voleger#6.1 Here is trying to fit returned data structure that was before changes. If we left to return $term as it is (an instance of TermInterface), then that require changes similar to #7 patch.
#6.2 Thanks, fixed.
Comment #10
volegerComment #12
volegerComment #13
wim leersThe #9 patch is for your
composer.lock, that must've been an accident :)Comment #14
volegerforgot
--stagedflag for diff (facepalm)Comment #15
wim leersAlright, #14's patch contains what #9 described, and is actually a reroll of #5 in response to my review in #6.
Comment #16
wim leersThe issue title says "convert DB queries to entity queries", but that's not possible for this one.
Still, it's better to use the
@databaseservice thandb_query(), which was deprecated in Drupal 8.0.x already.Comment #18
volegerSELECTsection is empty. Trying again.Comment #20
volegerComment #22
volegerComment #23
volegerComment #24
wim leersComment #25
volegerComment #26
volegerComment #27
catchWe should add accessCheck(FALSE) to this query and the other ones. It doesn't make any difference to the test because there's no acces control on the queries, but every query that's not rendering should do this and it's a common mistake in non-test code.
Comment #28
wim leers#27: TIL!
Comment #29
volegerComment #31
volegerComment #32
wim leersComment #33
catchThis is a problem as well - loadParents() doesn't do accessCheck(FALSE) or have an option to specify either way. Nor does getChildren() or getTree(). Have opened #2938848: TermStorage::loadParents()/getChildren()/getTree() need an option to specify accessCheck(FALSE) to discuss that further, it might be enough to just have the follow-up though, or should these use raw entity queries?
Comment #34
wim leersIMHO the follow-up is enough: part of the scope of #2938848 should be to look at all tests using this and update them to have
accessCheck(FALSE). There's lots of tests that use this already. Besides, that issue will have to evaluate every existing call in core and considering updating them to useaccessCheck(FALSE).Using a raw entity query here just increases the maintenance burden.
I think & hope you'll agree with this assessment.
So … back to RTBC.
Comment #36
catchThis applies cleanly to 8.6.x, so I've committed/pushed to that branch. It doesn't apply to 8.5.x, so marking this fixed against 8.6.x - nothing really stops us backporting to 8.5.x but it can also wait for the minor release IMO.