Closed (fixed)
Project:
Commerce Core
Version:
7.x-1.x-dev
Component:
Product reference
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Nov 2011 at 17:52 UTC
Updated:
2 Feb 2012 at 17:30 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
olafkarsten commentedHi derekw, we appreciate your reports, but we need the steps to reproduce the problem. If we can't reproduce a problem, we can't fight against it.
Comment #2
jeffschulerI'm experiencing this too.
Looking through backups, I see that my database has had this recursive mess for awhile, but it didn't start to actually affect things -- slowing down the site considerably, and erroring and timing out as derekw is seeing -- til recently.
I think this newer phase didn't start to happen until I added a couple new product types.
I've rolled back to before those new product types and am not experiencing the problem any more, though I still see the mess in the database.
I can't offer steps to reproduce this issue yet, but I hope we can try to track down why this is happening.
In my DB's menu_links table I see, for each product type:
Where in place of the "*" is the name of a product type -- one row for each.
Then, immediately following (in the same table):
The menu_router table shows similar stuff.
olafkarsten, I believe that the db snapshot I provided you with a couple weeks ago shows all of this.
Comment #3
olafkarsten commentedokay, something is going wrong, but why do you think it is the bundle module? We didn't touch the product type creation code. It's plain commerce core. Nevertheless I created a handful product types - setup as bundles - created product bundles from it - all on a fresh commerce kickstart install. Works like expected. So I have slight doubts, if we really have a bug here.
Comment #4
olafkarsten commentedI can get my database to this state too ;), but missed the moment when it happens :(. But it seems something in creating/editing product types. I'm pretty sure this is not caused by the product bundle module. Nevertheless I will try to reproduce this and get an idea where it comes from.
Comment #5
spuky commentedI have been bitten by that Problem too, it seems to come up when Drupal ist for some reason (installing new modules.. clearing cache ... is rebuilding the Menurouter... and the fields_ui is returning a multitude of viewmodes for commerce_products )
to get rid of the result I patched the core fields ui module... to not return them... but this is just fixing the Result of the Problem I will digg deeper as soon as possible...
Comment #6
olafkarsten commentedCan't find the culprit, but raise the Prio.
Comment #7
olafkarsten commentedHmm, I didn't understand what's going on. But I could narrow down the problem. It happens somewhat with the view_modes, if product references are involved in the product type. I have to test, if this happens without the bundle module enabled.
Comment #8
olafkarsten commentedIt happens if one add at least two product reference fields to a product type.
I think it happens when a product display with a product of these very product type is added. However, I'm not entire sure about this. We have to test this against a clean install and observe exactly when it happens. Then we can determine exactly what's needed to reproduce the error and ask some of the commerce core developer to have a look at this issue.
Comment #9
olafkarsten commentedOkay, here are the steps to reproduce the problem on a fresh commerce kickstart install (including the product samples, without any other module enabled).
1) Add a second product type.
2) Add two product reference fields to the new product type.
- On 'Product types that can be referenced' check the other type. This should be 'Product' on a clean installation.
3) Clear the cache to rebuild the menu (drush cc menu)
4) Have a look at the database tables menu_router, menu_links
SELECT * FROM `menu_links` WHERE `router_path` LIKE '%commerce_product_commerce_product%'SELECT * FROM `menu_router` WHERE `path` LIKE '%commerce_product_commerce_product%'You get some 16 rows or so and see the cluttered path. With each product reference (even if they are attached to other product types) things get more and more worth. (See #2)
I think we can invite now some of the commerce developer to help us. Maybe we should move this issue in the issue queue of commerce module.
Comment #10
jeffschulerMoving to Commerce queue, as this happens without Bundle installed.
Comment #11
olafkarsten commentedI didn't have the skills to solve the issue. If someone of the commerce dev's would point me somewhere :D, i would try to help.
I guess it's somehow related with the extra field code, but i'm completely unsure ...
Comment #12
mr.baileysI have been able to reproduce this by adding a Commerce Product Type and some Commerce Product Reference fields as outlined in #9. The
menu_linksandmenu_routerrecords are one indication of the problem, the bug also manifests itself in the "Custom Display"-section on the "Manage Fields"-page for the entities containing the product reference fields:I believe the issue is caused by commerce_product_reference_entity_info_alter.
This function cycles through all entities containing a product reference field, and for each one, copies all view modes from the that entity to the commerce_product entity. There is a bug in the query used to determine referencing entities (product displays) though, causing the copy operation to be executed once for each product reference field per entity.
At least that's what I think happens, still trying to better grok Commerce entities.
Patch attached.
Comment #13
mr.baileysattempt to come up with a more suitable title.
Comment #14
spuky commentedNice Catch...
I applied the Patch from #12 and removed my "keep Drupal working" workaroud core Patch that I mentioned in #5 things are Working
No overflow in the menu System... since I got about 12 Product references on a Product type this one was hurting me bad...
Comment #15
olafkarsten commentedthanks for that mr.baileys. I can confirm that #12 works.
Comment #16
jeffschulerThanks mr.baileys!!
Also confirmed it fixes via the process in #9.
About to try on a couple sites with which I was experiencing this issue, too.
Comment #17
jeffschulerAfter patching you'll obviously want to:
and clear the cache to remove existing crud, but it's looking good so far.
Comment #18
mr.baileysI think this clean-up is automatically performed when menu_rebuild() runs, so visiting update.php or the modules page should do the trick?
Comment #19
dpolant commentedPatch #12 works.
Comment #20
rszrama commentedOk, to be honest, this bug makes my head hurt. It's almost silly to even create product view modes for reference fields attached to products, but with the distinct query that should only happen once now avoiding the errors. Thanks for digging this up, my.baileys. You da man!
Thanks to all for the reviews. Committed.
Comment #21.0
(not verified) commentedmisidentified suspect module