Unable to add products to Catalog, especially if the Catalog has been altered.
This function only exists in one place:
ubercart/uc_product/uc_product.module: if ($taxonomy = module_invoke('taxonomy', 'form_all', 1)) {

Correct syntax exists in uc_catalog.admin.inc

In the current (Drupal 7.12) version, taxonomy_form_all has been removed from the taxonomy module.

Comments

rorschach.rev’s picture

Title: Catalog updates from Product failing - function removed » Catalog updates from uc_product use removed taxonomy function

Confirmed that the same problem exists in the ubercart-7.x-3.x-dev release 2012-Mar-10.

TR’s picture

Version: 7.x-3.0 » 7.x-3.x-dev
Priority: Major » Normal
Status: Active » Postponed (maintainer needs more info)

Yes, that legacy call to taxonomy_form_all() needs to be fixed.

But the only place it is used is on the advanced search form, and even there it's never called in D7 because the form_alter checks:

  if ($form_id == 'search_form')  && arg(0) == 'admin' && arg(1) == 'store' && arg(2) == 'products' && user_access('use advanced search')) {

The list of args is wrong for D7, so this piece of code is never used.

So I don't see how the taxonomy_form_all() call has anything to do with the title of this issue. Can you please explain what you mean when you say "Unable to add products to Catalog" ? On what page, and what exactly are you doing? What error message are you getting?

rorschach.rev’s picture

Thank you for your reply!

Store, Configuration, Catalog:
Catalog Display: Grid
Catalog Vocabulary: Products
(checked) Display the catalog breadcrumb.
The taxonomy vocabulary Products is set as the product catalog.

Store, Products, Select a Product, Edit
Catalog: - None - (and has no other options). <<<<<----------- (main issue)

I tried the repair catalog button as well.

< div class="field-type-taxonomy-term-reference field-name-taxonomy-catalog field-widget-options-select form-wrapper" id="edit-taxonomy-catalog">
< div class="form-item form-type-select form-item-taxonomy-catalog-und">
< label for="edit-taxonomy-catalog-und">Catalog < /label>
< select id="edit-taxonomy-catalog-und" name="taxonomy_catalog[und]" class="form-select">< option value="_none">- None -
< /option>< /select>
< /div>

So as far as I can tell, without knowing the data formats returned, uc_product has the incorrect query and uc_catalog.admin.inc uses a correct query, but I didn't see an example that attempted to return the same data format. If there is a module that supersedes uc_product's catalog/taxonomy functions I'm willing to switch. This is the default (core+ubercart only) code in place after having replaced the original Catalog. (The default code may work as long as you don't change the default data.)

rorschach.rev’s picture

This is a dev site, so I'd be willing to grant admin access if that would make things easier.

rorschach.rev’s picture

Update please, this should be a very simple fix for the maintainers.

longwave’s picture

Store, Products, Select a Product, Edit
Catalog: - None - (and has no other options). <<<<<----------- (main issue)

This dropdown is provided by the Drupal core Field UI, not Ubercart. I don't understand what vocabularies and fields you have set up, and how you have them configured; please give full details on how you changed the default config so I can try to reproduce this.

longwave’s picture

Re: #2

  if ($form_id == 'search_form' && arg(0) == 'admin' && arg(1) == 'store' && arg(2) == 'products' && user_access('use advanced search')) {

This code has existed since time began and is basically copied from http://api.drupal.org/api/drupal/modules!node!node.module/function/node_.... I'm not sure it was used even in 5.x..?

longwave’s picture

Removed that code from both branches.

rorschach.rev’s picture

I'm willing to grant temporary admin access to the server if you need to look at things.

I think this will duplicate the bug: delete the default taxonomy, add a new one using "add vocabulary".
Confirm the catalog being used for products at: admin/store/settings/catalog
Find orphaned products: admin/store/products/orphans (shows all products)
Click a product, attempt to assign it to a catalog. No catalogs appear.

Repair catalog field attempt: admin/structure/types/manage/product/fields
Find orphaned products again: admin/store/products/orphans (shows all products)
Click a product, attempt to assign it to a catalog. No catalogs appear again.

Installed are Views, Views UI, UC: Core, Catalog, Payment, Product Attributes, Reports, Roles, Shipping, Shipping Quotes, Product Kit, Stock. Also installed are Rules, Rules UI, Chaos Tools, Chaos Tools Page Manager, Superfish, etc. Captcha, Entity API, and social media plugins are also installed (AddToAny, etc)

longwave’s picture

I'd prefer it if you answered my questions in #6. Are you using the provided taxonomy_catalog field, or another field? When you deleted and recreated the vocabulary, did you also change the taxonomy_catalog field settings so it uses this new vocabulary?

I think this is basically the same problem that #1516598: Deprecate uc_catalog_vid in favour of taxonomy_catalog field configuration will solve.

rorschach.rev’s picture

I'm using the default field for a newly created taxonomy. I'm assuming that is taxonomy_alternative after I read the provided links. It sounds like I'm having the issue they are. Where can I validate which taxonomy type I'm using for certain? I tried checking the Field and Taxonomy modules. Did not see where to look inside the database itself to validate. I will keep looking for positive confirmation.

longwave’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)

No, you must use the Ubercart provided "taxonomy_catalog" field for the catalog block to show up correctly.

The issue linked in #10 will help reduce confusion firstly by removing the redundant "vocabulary" selection in the catalog settings, and then later allowing the field to be configurable so you could select "taxonomy_alternative" instead of "taxonomy_catalog".

rorschach.rev’s picture

The code released in issue #10 breaks the server when I made identical modifications to my store. The eventual resolution of issue #10 will indeed resolve the issue I'm having. Is there a specific code release I should use? I'm glad that the code is improving, but I'm wondering how to fix the issue I'm having where I can't add products to the visible list. Some people want their website to work :/

rorschach.rev’s picture

Priority: Normal » Minor

Because of this bug, lack of response, lack of support, I am no longer using UberCart. Thanks for the links, but if a link says "yeah we should fix this" that isn't a solution. If they say, "Here is a horrible hack to make it work" but the horrible hack doesn't work, then that isn't a solution.