Closed (fixed)
Project:
Views (for Drupal 7)
Version:
7.x-3.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
22 May 2010 at 01:20 UTC
Updated:
7 Jun 2011 at 21:21 UTC
Jump to comment: Most recent file
Comments
Comment #1
dawehnerI think this should be a setting on the query settings page(which is not ready yet)
In Drupal6 views generates the query, so it should be possible to develop the same feature there, too.
Comment #2
dawehnerOkay the query setting is ready so this can be developed.
Comment #3
Letharion commented@dereine
So this goes to the task queue?
Comment #4
dawehnerExactly.
Comment #5
cafuego commentedOkay, I am working on a patch.
Comment #6
cafuego commentedOk, you should probably wait for #1105848: Unsafe query comments possible via UI to be addressed before applying this :-)
Attached patch provided a textfield in the SQL Settings, allowing the user to enter a query comment. This is then prepended to the SQL statement, so for instance MySQL can write it to its slow_query_log if required.
Comment #7
dawehnerSo this is a patch again 7.x-3.x
Comment #8
cafuego commentedOh sorry, yes :-)
Comment #9
dawehnerquery_comment is not there in d7 nor d6. Why do we have to convert the options then?
Comment #10
cafuego commentedIs that not the bit of code that pulls the comment from the UI form and sticks it in the query object to be generated? I'm not particularly familiar with the views codebase, so I basically followed where DISTINCT is set and added query_comment just after that.
Comment #11
dawehnerThe destinct part was part of the main display configuration before, so the options had to be converted.
So needs work.
Comment #12
cafuego commentedRighto, I can just remove that section then - that makes life a tad easier. Thanks :-) I shall do a new patch shortly.
Comment #13
cafuego commentedRe-rolled the patch with the superfluous code block removed.
Comment #14
dawehnerIf you use this->options i don't get this part :)
Comment #15
dawehnerSo
Comment #16
cafuego commentedOh I see. Again a matter of replicating the distinct option for the query_comment - which of course wasn't there before. Removed in the attached patch. So as far as I can tell I now have left:
By my reckoning removing any more will break the functionality, so that should be it for the patch ;-)
Comment #17
cafuego commentedComment #18
dawehnerPlease reupload your patch, i can't look at it.
Comment #19
cafuego commentedI'm off in the country with pretty crap internet (and no git repo) at the moment. Shall re-upload when I get back home.
Comment #20
cafuego commentedRe-attached patch.
Comment #21
cafuego commentedAight, core (D7 and D8) are patched as per #1105848: Unsafe query comments possible via UI
Comment #22
dawehnerPatch worked fine.Thanks for all the reroles.
Commited to 7.x-3.x