Tags/topics: 
7
Answers
Vote up!
0
Vote down!

Problem creating new product types

Hi - I'm running Commerce version 7.x-1.3 on Drupal 7.14 (in case it's relevant, I also have the Product Display Manager (7.x-1.0-alpha3) installed). After not needing to create a new product type for several weeks, I had the occasion to do so recently and discovered that new product types now appear to be created in some sort of limbo state: I see them in the list of product types (http://example.com/admin/commerce/products/types), but without any of the operational links available, so I can't edit, manage fields/display, or delete these new product types from the UI.

I found this issue: #1190422 Adding a product type doesnt allow me to change/add fields, which seems similar, but unfortunately none of the workarounds for that issue work for me. And I found nothing similar on DrupalCommerce.org

Anybody else run into this - or, better yet, know how to fix it?

Thanks in advance!
Lee

Asked by: LNakamura
on June 20, 2012

Comments

Lee,

I am runnig in the same problem. Could you give some details about the patch that caused the issue?

- papirrin on December 1, 2012

7 Answers

Vote up!
1
Vote down!

If the menu items aren't being built properly, then you should be able to trigger it through a clearing of the cache. You can use the top button at admin/config/development/performance to clear it. Might do it twice in a row for good measure. ; )

Ryan Szrama
Answer by: Ryan Szrama
Posted: Jun 23, 2012

Comments

Hi, Ryan - thanks for taking a look at this!

Unfortunately, clearing the cache (twice, even - using Flush all caches from the admin menu) doesn't work for me... I have managed to programmatically delete these malformed product types by calling:
commerce_product_ui_product_type_delete($type_name);
(using a bit of code which I enable on an as-needed basis), but I still can't create a new, fully functional product type.

- LNakamura on June 23, 2012

Weird - I responded to your answer, but I don't see my response... testing...

- LNakamura on June 23, 2012
Vote up!
2
Vote down!

Yes, I need to get comments on Answers fixed, but my answer above still stands. The problem isn't with the product types, it's with the menu items not being rebuilt and stale caching. I've never had a problem with operations links showing up, especially after clearing the cache, so perhaps there's something else at play here. No need to open up a separate Question for this, though.

Ryan Szrama
Answer by: Ryan Szrama
Posted: Jul 25, 2012
Vote up!
1
Vote down!

[My responses to your answer seem to have disappeared into the ether, so I'll try responding by "posting an answer to this question" rather than adding a comment to your comment...]

Thanks, Ryan! Unfortunately, clearing the cache (via Flush all caches from the admin menu) doesn't work - even if I flush it twice in a row...

I have managed to delete these malformed product types using a bit of code I enable and disable when I need to (which calls commerce_product_ui_product_type_delete($type_name);), but I still can't create a fully functional new product type.

Answer by: LNakamura
Posted: Jun 23, 2012
Vote up!
0
Vote down!

A couple of additional points:
- I wasn't talking about the admin menu being malformed (though it is as well) - I was referring to the Products page, where I should see four links under the OPERATIONS column, but don't for any new product types which I create at the present time.
- It doesn't matter if I simply Save a new product type, or Save and add fields - the result is the same.

Answer by: LNakamura
Posted: Jun 23, 2012
Vote up!
0
Vote down!

Ryan - I just saw your response here! (Sorry about the duplicate Question.)

I just figured out what the underlying problem is: a patch for commerce_shipping () which enables a "Shipping same as Billing" checkbox on the checkout page was causing the following referential integrity error on just about every page access:

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'title' cannot be null: INSERT INTO {menu_router} (path, load_functions,

[:db_insert_placeholder_457] => [:db_insert_placeholder_458] => 0 [:db_insert_placeholder_459] => sites/all/modules/xmlsitemap/xmlsitemap.admin.inc ) in _menu_router_save() (line 3816 of /drupal_root/includes/menu.inc).

I determined that these issues were related when I discovered that the particular menu entry which was causing problems was shipping related - so I backed out the patch, and the errors went away (besides the integrety constraint, there was another error that showed up periodically) *and* I was immediately able to see the links for new product types.

Now to figure out which patch we applied to commerce_shipping!

Thanks for your help.

Answer by: LNakamura
Posted: Aug 5, 2012
Vote up!
0
Vote down!

(I snipped a *lot* of text out of the error message...)

Answer by: LNakamura
Posted: Aug 5, 2012
Vote up!
0
Vote down!

Just to follow up: I found the correct patch, determined where we went wrong in applying it, and resolved all the problems we were experiencing.

Thanks again!
Lee

Answer by: Anonymous (not verified)
Posted: Aug 7, 2012