Closed (fixed)
Project:
Ubercart
Version:
6.x-2.x-dev
Component:
Code
Priority:
Minor
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
8 Oct 2009 at 22:14 UTC
Updated:
25 Oct 2010 at 09:00 UTC
Jump to comment: Most recent file
This is a follow up to #587572: uc_price is undefined in uc_order_get_total() and sets out to standardise the use of require_once().
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 599572_require_once.patch | 5.63 KB | fenstrat |
Comments
Comment #1
fenstratComment #2
univate commentedTotal agree, I think some consideration should also be taken as to whether those require_once at the top of files need to be there and if they can be loaded more dynamically?
I suspect they can't for the CA stuff, if that is the case then how about using the hook_init() instead to include those files? and then you can use the module_load_include() function instead.
This is what I have done in the uc_recurring module
Taking this a step further it might be good to see CA handled similar to the way views works where you register views support via hook_views(), meaning the CA stuff could just be loaded when its actually required rather then on every page load.
e.g.
Comment #3
tr commentedI guess my question is, why do this? Drupal coding standards are mum on the subject, however Drupal core uniformly uses the form
require_once './path/to/file.inc';, not even bothering with the parentheses. So is this just a matter of your style is different than what Ubercart uses, or is there another reason I don't know about?I see the two places you changed to module_load_include(), and that's fine. I also think univate has a good point in #2, if someone wants to roll a patch to accomplish that.
Comment #4
tr commentedI committed the changes from require_once() to module_load_include(). I don't see the point of any of the other changes. I still think univate's suggestions as to dynamic loading make sense, so I'm going to leave the issue open.
Comment #5
univate commentedSince CA is being dropped for rules in ubercart-3.x it probably doesn't make sense to make large changes in CA.
Comment #6
fenstratCan appreciate why there was no commit on the require_once changes, there appears to be no uniform standard anywhere.
module_load_include() is standard, glad to see it committed.
As for the CA changes I agree with univate, so marking as fixed.