Closed (fixed)
Project:
Version Control API -- Git backend
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Issue tags:
Reporter:
Created:
29 Jul 2019 at 02:30 UTC
Updated:
5 Nov 2019 at 04:49 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
drummThis allows conditions on all of the columns in
versioncontrol_git_operations, includingauthor_name,committer_name,parent_commit, andmerge. For example:Comment #3
drummSlight coding standards improvement.
Comment #4
marvil07 commented@drumm, thanks for the patch!
Indeed, it is a good idea to expose data to entity field query.
The change looks good, I still need to test it, but I have one question:
A
QueryAlterableInterfaceis passed tohook_query_TAG_alter(), and I seegetTables()is used, which seems to come fromSelectQueryInterface.Is there a reason to assume that the received object implements
SelectQueryInterface?In most cases this is probably not a problem, but just to be on the safe side, we may want to add a condition like
if ($query instanceof SelectQueryInterface)before using it; it may also be that d7 OOP was not strict enough and some things are a bit assumed.I may be missing something here, so please let me know if that is the case.
Comment #5
drummEntityFieldQuerywill pass->addTag('versioncontrol_git_operations')into the select query it constructs, so it should always be aSelectQueryInterface, in this case. There could be a query tag collision, and something else adds that tag to a different query type.This patch adds this to fail noisily if that happens:
Comment #7
marvil07 commented@drumm, thanks for the added change!
I did a small manual test, and then I added a minimal test case.
This is now added to
7.x-1.x.