Posted by ogorun on October 17, 2009 at 4:58pm
Jump to:
| Project: | Ubercart Option Images |
| Version: | 6.x-1.4 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
| Issue tags: | performance nodeapi |
Issue Summary
uc_option_image_nodeapi() doesn't check whether it tries to make changes to product object. So it waste time on dealing with nodes of inappropriate types: page, story...
To fix this node type check should be performed before any action.
See attached patch that solves this problem (patch is created on base of version 6.x-1.4)
| Attachment | Size |
|---|---|
| nodeapi_performance.patch | 921 bytes |
Comments
#1
#2
@ogorun, I'd like to test your patch but I don't see uc_option_nodeapi trying to make changes to other nodes. It's probably because I'm not looking at the rigth place. Using Firebug I only see 'GET uc_option_image.js' on the appropriate product node. Can you point me in the right direction?
Thanks!
#3
Thanks for the patch. There is already a check to see if the node has attributes in the current dev version which keeps the rest of the functions from firing on non-product nodes.
<?php
40 $node->attributes = uc_product_get_attributes($node->nid);
41
42 if ($node->attributes) {
?>
#4
Automatically closed -- issue fixed for 2 weeks with no activity.