I have 29,050 products on my site.

After upgrading from 7.x-1.9 to 7.x-1.10 I'm getting memory errors when I clear my cache. I have done some backtracing to figure out where they're coming from:

  1. module_invoke_all("views_data")
  2. search_api_views_views_data()
  3. _search_api_views_add_handlers("field_product_reference", array of field info, EntityListWrapper here, array of entity properties)
  4. ...
  5. entity_metadata_field_options_list("field_product_reference", array of field info, "view")
  6. commerce_product_reference_options_list()
  7. commerce_product_match_products() - instance is null, string is null, match is "contains", ids empty, limit null

What happens is that when I clear my cache the views data gets updated and _commerce_product_match_products_standard() ends up choking on $products = commerce_product_load_multiple($pids);. If I drop a return just before that line I don't get memory issues and whatever page I'm on loads fine.

Comments

agileadam’s picture

I believe they're addressing this over here: #2096361: Move Product Match functions from db_select to EntityFieldQuery

I wanted to create this issue, though, with a title and description that may be helpful to others having the same issue that would overlook Move Product Match functions from db_select to EntityFieldQuery.

agileadam’s picture

This patch fixed the issue for me on Commerce 7.x-1.11: #2096361-23: Move Product Match functions from db_select to EntityFieldQuery

I did have to increase my max_execution_time to 90 seconds to get the foreach loop not to choke on the 29k products.

rszrama’s picture

Status: Active » Closed (duplicate)

Ok, I've asked mglaman specifically to test that patch; no need to keep two open issues for the same fix, even with the more specific title. We'll get the fix in ASAP.

agileadam’s picture

Sounds great. Sorry to muddy the waters :)