Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
PHPDoc references CommentStorage::buildQuery on SqlContentEntityStorage::buildQuery. This method no longer exists nor there is any other example adding conditions in core, so I think it can just be removed.
/**
* Builds the query to load the entity.
*
* This has full revision support. For entities requiring special queries,
* the class can be extended, and the default query can be constructed by
* calling parent::buildQuery(). This is usually necessary when the object
* being loaded needs to be augmented with additional data from another
* table, such as loading node type into comments or vocabulary machine name
* into terms, however it can also support $conditions on different tables.
* See Drupal\comment\CommentStorage::buildQuery() for an example.
Thanks
Comment | File | Size | Author |
---|---|---|---|
#16 | 3052755-16.patch | 1.52 KB | sam711 |
#12 | 3052755-12.patch | 1.07 KB | mdupont |
Comments
Comment #2
valthebaldComment #3
mdupontI am at DrupalCon Amsterdam 2019 and am working on this issue.
Comment #4
mdupontComment #5
hanan alasariHi, im from Drupalcon in Amsterdam 2019, am working on this issue.
Comment #6
wengerkHey there ! I'm mentoring @hanan_apw and @mdupont at the Drupalcon in Amsterdam 2019.
Let's create a patch for this issue and having fun !
Comment #7
mdupontCommentStorage::buildQuery()
was removed in 2014 with #2292815, and there is no other example of extending thebuildQuery()
method in Core. Tested against 8.8.x branch.Comment #8
wengerkLet's put this issue in review for now.
Comment #9
hanan alasariThank you, this patch worked for me too.
Comment #10
wengerkAll the team (@hanan_apw, @mdupont, @solide-echt & @gdejonghe) review the patch let's put in in the Reviewed & tested by the community.
Let's see if testbot make our patch pass (which should as we only change a comment).
Comment #11
alexpottSo this shows that actually when need to update4
As this such as is also no longer applicable.
FYI the comment storage override was removed in #2292815: Remove join comments on users table
Comment #12
mdupontRemoved DocBlock reference to altering comments entities, as per @alexpott message in #3052755-11: Remove PHPDoc reference to CommentStorage::buildQuery() on SqlContentEntityStorage
Comment #13
mdupontAs the same code is present in the 9.0.x branch, I suggest to fix it there first. Same patch applies in 9.0.x, 8.8.x and 8.7.x AFAICS.
Comment #14
mdupontAfter discussing on Slack #contribute, it turns out the preferred way forward is to fix in 8.9.x first.
Comment #15
init90Before RTBC here needed one small change.
Instead of class reference in @return docblock:
will be better use reference to interface:
Comment #16
sam711 CreditAttribution: sam711 as a volunteer commentedYou're right, but I think the description was more accurate in first place.
Patch updated according to @init90 about the returned interface.
Thank you all!
Comment #17
init90Thanks!
Comment #18
alexpottCommitted and pushed to 9.0.x and to 8.9.x and to 8.8.x. Thanks!
Backported to 8.8.x as a docs fix.