Closed (fixed)
Project:
Documentation
Component:
Coding standards
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Jun 2008 at 13:29 UTC
Updated:
23 Jul 2008 at 10:56 UTC
Point 4 in this part of the document does not comply with drupal 6 coding standards, and should not be enforced.
http://drupal.org/node/114774#db-query-standard
Comments
Comment #1
pasqualleComment #2
gpk commentedCan you clarify in what way point 4 does not comply with D6 coding standards http://drupal.org/node/2497#formatting? I can't see the discrepancy :-?
Comment #3
pasqualleBecause as I see drupal 6 core does not follow this standard. I will try to count all the examples in drupal core, and all issues where such modification in core was rejected..
Comment #4
gpk commented>as I see drupal 6 core does not follow this standard.
Ahhhh...!
>count all the examples in drupal core, and all issues where such modification in core was rejected.
Hmmm curious..!
Comment #5
pasquallecounts in drupal core
rule broken vs compliance with the rule
includes dir:
13:8
modules dir:
20:1
I just stopped counting, the one was for better visibility not because the developer wanted to follow this rule. You can hardly find any occurrence in modules directory where this rule applies..
So, this rule is not a coding standard for drupal 6, never was..
Comment #6
pasquallequick search for rejected issues
#175704: SQL cleanup: /includes
#175825: SQL cleanup: aggregator
#175826: SQL cleanup: block
Comment #7
pasqualleComment #8
add1sun commentedThis was added to the page by hswong who was also the one trying to get the cleanup patches in. See the revision diff here: http://drupal.org/node/114774/revisions/view/189503/190765
It looks like even though he conceded this did not need to change (http://drupal.org/node/175704#comment-605038) he never went back and cleaned up the handbook page edits he made.
So basically yes, his changes didn't go in and that info needs to be removed from the page since it never really belonged there. I don't have time to do this myself right now.
Comment #9
catchRemoved.
Comment #10
gpk commentedShould this also be fixed (http://drupal.org/node/2497):
Avoiding SQL injection is one thing, but I think we are saying that it's currently OK to have literal values *in* the query body?
Comment #11
catch@gpk - looks like it. More stuff added by hswong3i - revision diff here: http://drupal.org/node/2497/revisions/view/190378/190800
Comment #12
gpk commentedWell it's not a patch but I'd be grateful if someone could check that my edits make sense!
http://drupal.org/node/2497/revisions/view/303850/320192
Ta.
Comment #13
pasquallethe db_query example is still incorrect on that page (2479)
should be changed to a real example from drupal core
Comment #14
gpk commentedFrom a quick grep I'd say core is not 100% consistent about whether or when literals should be included in the body vs. substituted in via placeholders.
Maybe this example from php.install is a more useful illustration:
Comment #15
pasqualleyes, that's better
Comment #16
gpk commentedOK try now http://drupal.org/node/2497.
Comment #17
catchLooks good to me. In general that page reads a bit abruptly, but that's not one for this issue (and wasn't introduced by it either).
Comment #18
gpk commentedOK great :)
Comment #19
pasquallethanks Giles
Comment #20
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.