The problem is this change:
http://drupal.org/cvs?commit=366426

As seen in uc_product's uc_product_is_product() function, products can actually be any node type returned by the uc_product_types() function, not just 'product'.

I can submit a patch if you like. It would probably involve calling uc_product_types() and modifying the query so it selects nodes with one of those types. However, that does cause at least one extra database query (uc_product_types() invokes hook_product_types(), and uc_product's own implementation calls uc_product_node_info() which does the query), so I don't know which is better - that or the original INNER JOIN.

CommentFileSizeAuthor
#2 uc_affiliate2-801304.patch1.94 KBdarktygur-1
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bojanz’s picture

Some people have reported a huge number of products. In that case, a query (or two) more will probably be a lot less expensive then an INNER JOIN.

Weigh the options (maybe even measure the inner join performance), and submit a patch, I trust you on this one.

darktygur-1’s picture

Status: Active » Needs review
FileSize
1.94 KB

You're right. I probably didn't notice #757414: PHP Out of Memory fixed, but using too much resources to generate product links until after posting this issue. I don't really have time to compare performance, but with a huge number of products, it does make sense to avoid an inner join and go for a quick extra query or two (with less potential to take an increasing amount of time with an increasing number of products).

bojanz’s picture

Status: Needs review » Fixed

Looks good. Committed, thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.