Closed (fixed)
Project:
Ubercart
Version:
6.x-2.x-dev
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Reporter:
Created:
8 Jan 2009 at 08:08 UTC
Updated:
17 Feb 2009 at 15:40 UTC
Jump to comment: Most recent file
Finally got around to installing/using ubercart, and found the error log littered with warnings.
The attached patch is my first-pass attempt at eliminating the worst offenders.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | variable_cleanup.patch | 17.01 KB | cha0s |
| #8 | variable_cleanup.patch | 17.28 KB | cha0s |
| #5 | ubercart-fixes.diff | 27.39 KB | pillarsdotnet |
| #4 | ubercart-fixes.1.patch | 8.72 KB | cha0s |
| #2 | ubercart-fixes.diff | 10.47 KB | pillarsdotnet |
Comments
Comment #1
Island Usurper commentedWe're not planning on porting uc_importer or uc_notify, so there's no need to include their files in this patch.
As a matter of consistency, I usually prefer isset() to empty(). This is partly because there are times when the data that is checked has a value of 0 or '', and that's the value that should be used rather than the default used when it is NULL. I think the only place this is actually important in this patch is in uc_product_form(), for $node->default_qty. The default value is 1, but a value of 0 is never displayed in the form, despite the fact that it is a valid value.
Comment #2
pillarsdotnet commented@Island Usurper:
(checking...) Hmm... must have been working from old code (??) Patch revised.
You are correct; I have grown over-fond of empty() because my most frequent use is to replace:
with
Revised patch attached; created via "cvs diff" from today's DRUPAL-6--2 checkout.
Comment #3
pillarsdotnet commentedChanged status
Comment #4
cha0s commentedI cleaned up a couple of small things, just aesthetics.
Comment #5
pillarsdotnet commentedApplied suggested changes, plus more fixes. Notably, disabling fields actually causes them to disappear from the display, now. (yay!)
note: patch looks big because wrapping some code in if() blocks changes indentation.
Comment #6
cha0s commentedNice, but for ease of comprehension's sake, you should separate the views changes from the undefined variable changes. Put the overlapping changes into the views patch (i.e. if a variable has been created by your view patch, and you do an isset check, put it in the views patch)
One small thing too, in uc_store.module, do the if like this:
not like this:
Just a consistency thing :). Thank you for your contribution(s)!
Comment #7
Island Usurper commentedComment #8
cha0s commentedPatch for views: #367730: Views fixes
Attached the patch for variable cleanup.
Comment #9
Island Usurper commentedI'm a little worried about the use of the static keyword in uc_product_field_enabled(). I imagine that something like SimpleTest would change the value of the variable, and then call that function again and get the wrong values. Variables are all cached anyway, so I don't think it's necessary to do it again.
There are at least 3 solutions that I can think of, but I think the best one is the easiest, which is just remove the static keyword. The rest of the function can stay the same, and so can its use in this patch.
Comment #10
cha0s commentedAs you have requested...
Comment #11
Island Usurper commentedWow. Committed this, but almost forgot to mark it fixed.
Comment #12
acsooley commentedWould this patch fix:
When I try to create a view for the main page to display a image of the product, price and add to cart button I get an error on adding the image to the view:
Error: handler for node_data_field_image_cache > field_image_cache_fid doesn't exist!
All other fields work and display on the view except for the image. Any help would be great.
Adam