The problem is that the product type is passed as an argument for title callbacks and page callbacks. What the menu module does, is that is serializes the data and tries to save it in the menu_router table. The thing is, that the column where this serialized data is saved is of type varchar(255). This naturally limits the data that can be saved. Since the product_type can have a description and help text of arbitrary length, defined by an admin, this will cause the menu link generation to fail if the description and help combined text is too long.

Instead we should pass the type and let the functions load the actual product type.

Comments

googletorp’s picture

Status: Active » Needs review
das-peter’s picture

What about using this for the title:
'title' => $product_type['name'],

Other stuff looks perfectly reasonable to me.
Also the change of commerce_product_type_title, first because I think it should use the same pattern as the other functions, second because it adds now really a value by converting a type into a title instead just returning something you could easily access without the function ;)

rszrama’s picture

Issue tags: +beta blocker
googletorp’s picture

I changed what das-peter sugested: github

rszrama’s picture

Status: Needs review » Fixed

Committed with this follow-up:

https://github.com/rszrama/drupalcommerce/commit/88eb7a7f1e40183e410ef50...

I'm not sure if you tested your patch in the UI, but I'm pretty sure that without these fixes the add form and the edit form should've been broken / inaccessible. : ?

googletorp’s picture

I didn't actually check the menus afterwards only that the menu was created. I searched where the functions were called, but my editor must have missed something, since I only could find them referenced once. My bad.

rszrama’s picture

No worries. Just making sure I wasn't reading it wrong.

Status: Fixed » Closed (fixed)
Issue tags: -beta blocker

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