Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Duplicate Seo Names In Database Rate Topic   * * * * * 1 votes

 

Posted 04 October 2014 - 07:45 PM #1

Does anyone know why I would have two SEO names that are the same in the database?

help-faq

appears twice. See screenshot attached.

I'd be grateful for anyone's help in figuring out how this could have happened, whether it's a problem, and how to fix it.

Attached Thumbnails

  • Screen Shot 2014-10-04 at 3.40.25 PM.png


 
  • Magpie Don
  • Senior Member
  • Members
  • Join Date: 01-Apr 09
  • 816 posts

Posted 04 October 2014 - 07:57 PM #2

Looks like one us for Company 1, and the other is for Company 0

CS-Cart Ultimate ver 4.9.3 SP1


 

Posted 04 October 2014 - 08:00 PM #3

I only have one company. :-)

Also, I have a feature variant that I misspelled and I can't get rid of it. Maybe it doesn't matter. I delete the name from the SEO Names table and it disappears. Then I go to try to delete it from the product_feature_variant_descriptions table and it just keeps coming back. So does the SEO Name.

I also can't delete or change any of the feature variants or seo names from the backend of CS-Cart. It acts like it does, but then the stuff magically re-appears.

I've spent a couple of hours chasing my tail on this and starting to feel a bit aggravated.

 

Posted 04 October 2014 - 08:17 PM #4

Here is another duplicate. You can see that the company ID seems to be random. Why would this be?

Screen Shot 2014-10-04 at 4.13.06 PM.png

 
  • P-Pharma
  • Junior Member
  • Members
  • Join Date: 30-Jun 10
  • 1138 posts

Posted 05 October 2014 - 02:27 PM #5

It's exactly this buggy behavior why I abandoned my complete installation and started over from scratch. We are currently filling a fresh install with thousands of products/options. I am waiting with sharing products between stores and adding any languages as it went south when we did that.
I would much like to understand when and why this happens.
Do you have multiple languages?

 
  • Magpie Don
  • Senior Member
  • Members
  • Join Date: 01-Apr 09
  • 816 posts

Posted 05 October 2014 - 02:47 PM #6

Doesn't the company value of '0' indicate the content is available for ALL stores (if you have multiple stores set up)?
This doesn't explain WHY you would find an SEO name for a Feature, like author name, with an SEO name for ALL stores & another for just store #1, much less HOW that happens.

CS-Cart Ultimate ver 4.9.3 SP1


 
  • Magpie Don
  • Senior Member
  • Members
  • Join Date: 01-Apr 09
  • 816 posts

Posted 05 October 2014 - 03:37 PM #7

Here is a fun Sunday morning query I wrote to show (and count) duplicate SEO names:
SELECT  a.*, b.totalCount AS Duplicate
FROM cscart_seo_names a
INNER JOIN
(
SELECT name, COUNT(*) totalCount
FROM cscart_seo_names
GROUP BY name
) b ON a.name = b.name
WHERE b.totalCount >= 2


All my duplicates are in Categories - which is fine because the WHOLE SEO URL includes the Parent Category + the Sub Category, which means the fully assembled SEO URL is unique and I do have Sub Categories with the same name in different Parent Categories.

CS-Cart Ultimate ver 4.9.3 SP1


 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11392 posts

Posted 05 October 2014 - 08:06 PM #8

Category names (type=c) should be unique with object_id.

In a single store installation, the company_id is zero and it takes special handling in the coee to get the real company_id.

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 

Posted 05 October 2014 - 08:14 PM #9

Do you have multiple languages?


No, just English. I started with a v2.x installation back in 2009, upgraded to 3.x, then upgraded to 4.x Now I'm on 4.2.2 Always stayed with the Pro version (or whatever they call it...maybe it's called Ultimate now).

Only ever had one storefront/company and one language. It seems pretty weird to me. I've gone through the SEO Names table manually in phpMyAdmin and think I've eliminated all the duplicates but who knows.

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11392 posts

Posted 05 October 2014 - 08:21 PM #10

I would guess that at some point you've had more than one store defined (could have been during 1st upgrade to V4). Your image shows a number of 1/0 company_id's and if you're running one store (I.e. can't see an "all stores" in the upper left of admin header) then the company_id should be zero.

Having 2 names with different company_id's should be fine. It should grab the right one.

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19780 posts

Posted 06 October 2014 - 07:22 AM #11

Did you run the query created by Magpie Don? Do you have duplicated seo names for all objects? Or just these examples?

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 

Posted 06 October 2014 - 11:07 AM #12

Did you run the query created by Magpie Don? Do you have duplicated seo names for all objects? Or just these examples?


I just ran the query and got 2 duplicates. As I say, I ran through it manually. These last two have one for each company ID, 0 and 1.

This whole "two companies" thing is still a mystery to me because at no time was I aware of defining two companies or stores and my current site shows only one store defined in the backend.

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19780 posts

Posted 06 October 2014 - 02:34 PM #13

I just ran the query and got 2 duplicates. As I say, I ran through it manually. These last two have one for each company ID, 0 and 1.

This whole "two companies" thing is still a mystery to me because at no time was I aware of defining two companies or stores and my current site shows only one store defined in the backend.


I do not think that this can cause any problem in your store, but post it as a bug to the bug tracker

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • Magpie Don
  • Senior Member
  • Members
  • Join Date: 01-Apr 09
  • 816 posts

Posted 06 October 2014 - 05:59 PM #14

In a single store installation, the company_id is zero and it takes special handling in the core to get the real company_id.


I'm not sure this is true in v4.
V4 is now all Ultimate with multi-store capability and the first thing you must do when installing, for even a single store, is to create a store/company and CS-Cart assigns this store/company as Company 1 (company_id = 1). All my products are assigned to Company 1. I have content pages and categories that are assigned to Company 0 and that content is displayed in the store.

I think when company_id is set to 0, it is content available for ALL stores because CSC assumes that other stores could be set up.
So it should be theoretically possible to universally set company_id = 0 OR company_id = 1 IF you only have one store. It shouldn't make any difference. It doesn't make any difference in my store.

CS-Cart Ultimate ver 4.9.3 SP1


 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11392 posts

Posted 06 October 2014 - 06:20 PM #15

I know it to be true since you have to use code like below to get the company_id in admin on a signle-store installation.
    ?company_id = Registry::get('runtime.forced_company_id')
            ? Registry::get('runtime.forced_company_id')
            : Registry::get('runtime.company_id');

Just do a search of the functions directory for 'forced_company_id' and you will see.

My bet in Kingsley's case that it's leftovers from his original store import or conversion to V4.

Otherwise it will use zero which is the default for "all stores" but in a single compnay installation there is no "all stores". They call it the "simple ultimate view".

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.