Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Join Date
    Dec 2008
    Location
    Toronto
    Posts
    347
    Plugin Contributions
    0

    Default Category called "Unknown (id 17)"

    We've discovered we have a large quantity of products that were previously deleted using the Admin that are still present in the database under a category called Unknown (id 17). The products and category don't show in the Admin but do show when you do a product export using Apsona.

    What's the best strategy for properly removing the products and the category?

    Any help is appreciated. Thanks.



    Database: MySQL 5.5.5-10.1.37-MariaDB
    HTTP Server: Apache
    PHP Version: 5.6.38 (Zend: 2.6.0)

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Category called "Unknown (id 17)"

    Zen Cart would never create a category called "Unknown (id 17)". That's come from some other tool you're using.

    In your database, what's that category's categories_id number?
    Take that number and go into your Admin->Catalog->Categories/Products page and click on a category. Then change the cID in the URL to that number and press Enter to load that category.
    Do the products show? You could delete them from there.

    You could also use the the Tools->Store Manager option for resetting all products master_categories_id. But be aware that this may mess with products you've linked to other categories.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: Category called "Unknown (id 17)"

    I had a slightly different idea, but had to reload the page because my token had expired.Sounds like the product may have in some way been linked to category 17 and in deletion the master_categories_id did not get properly reassigned. Two ways I can think of correcting this, though probably could come up with several.The first (though I don't think best) was to create a new category and then reassign the categories_id to 17. Then properly delete the product. In a way this touches the database more than it should especially with the reassignment to a previously existing number.The other is to run a query reassigning the master_categories_id for those having 17 to reassign them to some existing category (even if that category is made just for this purpose).The sql to reassign the identified product to another category (27 picked for discussion) is:
    Code:
    UPDATE products SET master_categories_id = 27 WHERE master_categories = 17;
    Though DrByte's method seems like it could be "easier" to an extent. My thought with the product being assigned to a category (preferably of its own) was that I thought an option was offered when deleting a category to also delete all of the product in it...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  4. #4
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Category called "Unknown (id 17)"

    Quote Originally Posted by mc12345678 View Post
    My thought with the product being assigned to a category (preferably of its own) was that I thought an option was offered when deleting a category to also delete all of the product in it...
    I agree, but I wanted to see what the reaction was to my prior comments before getting into actual sql changes. THere's the added wrinkle of things not being in the products_to_categories table as well, which means you can't find the category in the admin panel in order to click delete on it in order to delete all the products inside it. Your suggestion to just change all the master_categories_id to a new category created just to be deleted is one suitable way.
    One could also just create a new category with id 17 (manually in the database, in both tables), which would make it appear in the Admin, and then could be deleted.

    But there's a root cause here too: what actually caused the problem in the first place. If the category is called "Unknown (id 17)" then it wasn't created by Zen Cart core code: It was caused by some third party package. And thus there are likely some additional complications beyond just wanting to properly delete all related remnants of these orphaned products.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Dec 2008
    Location
    Toronto
    Posts
    347
    Plugin Contributions
    0

    Default Re: Category called "Unknown (id 17)"

    Quote Originally Posted by DrByte View Post
    Zen Cart would never create a category called "Unknown (id 17)". That's come from some other tool you're using.

    In your database, what's that category's categories_id number?
    Take that number and go into your Admin->Catalog->Categories/Products page and click on a category. Then change the cID in the URL to that number and press Enter to load that category.
    Do the products show? You could delete them from there.

    You could also use the the Tools->Store Manager option for resetting all products master_categories_id. But be aware that this may mess with products you've linked to other categories.
    Thanks for the reply. I can get the category 17 to load by logging in and changing the cID. Category 17 has many sub categories in it, when I try to delete one of those categories I get "WARNING: An Error occurred, please refresh the page and try again."

  6. #6
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Category called "Unknown (id 17)"

    Quote Originally Posted by kcb410 View Post
    I get "WARNING: An Error occurred, please refresh the page and try again."
    When that happens on admin pages a myDebug-adm-xxxxxxx.log file is created in your /logs directory, containing the actual error message. What is it?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  7. #7
    Join Date
    Dec 2008
    Location
    Toronto
    Posts
    347
    Plugin Contributions
    0

    Default Re: Category called "Unknown (id 17)"

    Quote Originally Posted by DrByte View Post
    When that happens on admin pages a myDebug-adm-xxxxxxx.log file is created in your /logs directory, containing the actual error message. What is it?
    Here's the log contents:

    [09-Jan-2019 15:12:27 America/New_York] PHP Fatal error: 1146:Table 'kcbgraph_pm410.TABLE_PRODUCT_EXTRA_FIELDS' doesn't exist :: delete from TABLE_PRODUCT_EXTRA_FIELDS
    where products_id = '710' ==> (as called by) /home/kcbgraph/public_html/XXXXXXXX/includes/modules/delete_product_confirm.php on line 54 <== in /home/kcbgraph/public_html/includes/classes/db/mysql/query_factory.php on line 155

  8. #8
    Join Date
    Dec 2008
    Location
    Toronto
    Posts
    347
    Plugin Contributions
    0

    Default Re: Category called "Unknown (id 17)"

    Quote Originally Posted by kcb410 View Post
    Here's the log contents:

    [09-Jan-2019 15:12:27 America/New_York] PHP Fatal error: 1146:Table 'kcbgraph_pm410.TABLE_PRODUCT_EXTRA_FIELDS' doesn't exist :: delete from TABLE_PRODUCT_EXTRA_FIELDS
    where products_id = '710' ==> (as called by) /home/kcbgraph/public_html/XXXXXXXX/includes/modules/delete_product_confirm.php on line 54 <== in /home/kcbgraph/public_html/includes/classes/db/mysql/query_factory.php on line 155
    I believe this error could be referring to the Product Extra Fields plugin we were using up until Zen 151, we stopped using it so possibly it wasn't brought forward during the Zen 154 upgrade. Would installing it resolve the issue and allow me to delete the products in category 17?

  9. #9
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,691
    Plugin Contributions
    9

    Default Re: Category called "Unknown (id 17)"

    Quote Originally Posted by kcb410 View Post
    I believe this error could be referring to the Product Extra Fields plugin we were using up until Zen 151, we stopped using it so possibly it wasn't brought forward during the Zen 154 upgrade. Would installing it resolve the issue and allow me to delete the products in category 17?
    it might; but it seems a little silly to me....

    when you uninstalled the plugin, you did not remove the modified code that the plugin had you change. if you are not using the plugin, i would try and go back and remove all of the code associated with that plugin. that way you can be closer to the unmodified core code making it easier for future upgrades.

    you can seach for TABLE_PRODUCT_EXTRA_FIELDS to see what code needs to be removed.

    good luck.
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  10. #10
    Join Date
    Dec 2008
    Location
    Toronto
    Posts
    347
    Plugin Contributions
    0

    Default Re: Category called "Unknown (id 17)"

    Quote Originally Posted by carlwhat View Post
    it might; but it seems a little silly to me....

    when you uninstalled the plugin, you did not remove the modified code that the plugin had you change. if you are not using the plugin, i would try and go back and remove all of the code associated with that plugin. that way you can be closer to the unmodified core code making it easier for future upgrades.

    you can seach for TABLE_PRODUCT_EXTRA_FIELDS to see what code needs to be removed.

    good luck.
    Thanks for the reply. I'll give that a try first thing in the morning.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Reorder Category called "New Products..."
    By karine in forum Setting Up Categories, Products, Attributes
    Replies: 6
    Last Post: 13 Nov 2012, 12:43 AM
  2. What are "medium" and "large" images called in admin, and which size are recommended?
    By Nina_Paris_France in forum Customization from the Admin
    Replies: 4
    Last Post: 11 May 2011, 03:01 PM
  3. How to remove sub-category "featured products" & "category image"?
    By andrewcklau in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 24 Jun 2010, 10:32 AM
  4. "Pop out" image viewer mod..? Whats it called
    By fastdc5 in forum General Questions
    Replies: 1
    Last Post: 17 Feb 2009, 02:38 PM
  5. Ready to go live - new problem - sidebox called "Documents"
    By ginginca in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 8 Dec 2006, 12:48 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR