1. atrus
  2. RO CSVI
  3. Thursday, 30 July 2015
  4.  Subscribe via email
Hi Roland,

Noticed the following:

Trying to import the attached product but the slug is stripped to max 64 characters from what i can see. Is this smth new with CSVI? Because in 6 beta the slugs had no limit i think. Also VM supports longer slugs than 64 chars.If this is the case, can we disable this limit somehow?

i checked the _virtuemart_products_ tables and noticed that :the product_name is char(180) and slug is char(192)

See attached the log for your info. This caught my eye:

[code type=php]2015-07-30 19:40:43 1 [DEBUG] Check if the product slug exists
2015-07-30 19:40:43 1 [QUERY] SELECT COUNT(`virtuemart_product_id`) FROM y9zak_virtuemart_products_en_gb WHERE LEFT(`slug`, 64) = 'universal-stainless-steel-exhaust-tips-viper-eyes-mercedes-amg-9' AND `virtuemart_product_id` != 37
2015-07-30 19:40:43 1 [DEBUG] Check if the product slug exists
2015-07-30 19:40:43 1 [QUERY] SELECT COUNT(`virtuemart_product_id`) FROM y9zak_virtuemart_products_en_gb WHERE LEFT(`slug`, 64) = 'universal-stainless-steel-exhaust-tips-viper-eyes-mercedes-amg-s' AND `virtuemart_product_id` != 37[/code]

and the updated slug is 64chars only:

2015-07-30	19:40:43	1	[QUERY]	UPDATE `y9zak_virtuemart_products_en_gb` SET `product_s_desc`='
Stainless Steel SUS304 / T304
',`product_desc`='',`product_name`='universal Stainless Steel Exhaust Tips 'Viper Eyes Mercedes AMG S65 Look' 90 Degrees 258x72 L235 IN64',`metadesc`='Stainless Steel SUS304 / T304',`metakey`='stainless,steel,sus304,,,t304',`customtitle`='',`slug`='universal-stainless-steel-exhaust-tips-viper-eyes-mercedes-amg-1' WHERE `virtuemart_product_id`='37'


Would appreciate your advice!

Rgrds,
Chris
Accepted Answer Pending Moderation
Hello Chris,

I had written a whole story about index sizes etc. but now I wonder if I misread the whole reasoning of 64 and I can't even reproduce that limit I saw before. Attached is a patch file that reverts the changes of the 64 limit. Please apply the patch and let me know if it is OK for you.
Attachments (1)
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 1
Accepted Answer Pending Moderation
Thanks Roland, works ok :)

Chris
  1. more than a month ago
  2. RO CSVI
  3. # 2
Accepted Answer Pending Moderation
Hi Roland,

Issue is still present in 6.1.2, i just got the following error while importing:

"Duplicate entry 'universalnyj-nerzhaveyushchaya-stal-nasadka-na-glushitel-dvukhme' for key 'slug' SQL=UPDATE `y9zak_virtuemart_products_ru_ru` SET `product_s_desc`='',`product_desc`='',`product_name`='универсальный Нержавеющая сталь Насадка на глушитель двухместная Mercedes AMG стиль 227x70 L200 IN60 смещённый центр (Левое)',`metadesc`='',`metakey`='',`customtitle`='',`slug`='universalnyj-nerzhaveyushchaya-stal-nasadka-na-glushitel-dvukhmestnaya-mercedes-amg-stil-227x70-l200-in60-smeshchjonnyj-tsent' WHERE `virtuemart_product_id`='1147'"

The string universalnyj-nerzhaveyushchaya-stal-nasadka-na-glushitel-dvukhme is indeed 64 chars long.

Should i try the patch again?

Rgrds,
Chris
  1. more than a month ago
  2. RO CSVI
  3. # 3
Accepted Answer Pending Moderation
Hello Chris,

Applying the patch is not going to do anything because the code in the patch is already in 6.1.2. All I am thinking is that the limit I was speaking about before is what you are seeing and what I saw before when I made the changes in the first place.

You are saying that the issue is still present but it is a different issue, now it is not the code making a unique alias, now it is the database saying you have a duplicate alias. That is exactly the issue that was solved in the first place with the modified slug.

It is not the size of the slug field but the index that MySQL keeps on that field. You could remove the index on the slug field, that will allow the import to run but I think it will have a performance penalty.

One way or another, a change is needed if you want to keep such slugs.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 4
Accepted Answer Pending Moderation
Thanks Roland,

Did some further testing, and i isolated the culprit entries. I also truncated the complete vm table i made a fresh import. The attached csv with 3 products gives the following error (no log produced):

Duplicate entry 'universalnyj-nerzhaveyushchaya-stal-nasadka-na-glushitel-dvukhme' for key 'slug' SQL=INSERT INTO `y9zak_virtuemart_products_ru_ru` (`virtuemart_product_id`,`slug`) VALUES (1147, 'universalnyj-nerzhaveyushchaya-stal-nasadka-na-glushitel-dvukhmestnaya-mercedes-amg-stil-227x70-l200-in60-smeshchjonnyj-tsent')

FYI, the product IDs in our installation for these 3 products are respectively: 75, 1147, 1148

I can see that some stripping of slug characters is done on the 2nd product entry (1147) and that causes the duplication issue with the 1st product (75) slug but cannot be exactly sure of the cause!

We are on J3.4.4 / VM3.0.9.8 / CSVI 6.1.2

Rgrds,
Chris
Attachments (1)
  1. more than a month ago
  2. RO CSVI
  3. # 5
Accepted Answer Pending Moderation
Hey Chris,

I can see that some stripping of slug characters is done on the 2nd product entry (1147) and that causes the duplication issue with the 1st product (75) slug but cannot be exactly sure of the cause!
That is exactly the issue I saw with the index length enforced by MySQL. I have found it again:
The maximum number of indexes per MyISAM table is 64.
(source).

The only way around this for CSVI is to strip the alias and make it unique before the 64th character. If you want to keep the alias as is, you can remove the unique index setting on the table for that.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 6
Accepted Answer Pending Moderation
Hi Roland,

I'm abit confused, so apologies until i clear all this in my mind :blink:

The maximum number of indexes per MyISAM table is 64.


Talking about unique indexes, ok. But how the number of unique indexes relates to the field length? It seems to me it is a totally different thing. (Index length and max. no of indexes are the same?)

The only way around this for CSVI is to strip the alias and make it unique before the 64th character.


So it is a weak point for CSVI? Because if i enter the slugs manually in VM product edit screen, they get saved nicely in the database, no error for duplicate slug (we have slugs with 120+ chars saved by VM and previous versions of CSVI)

Thanks!
Chris
  1. more than a month ago
  2. RO CSVI
  3. # 7
Accepted Answer Pending Moderation
Hello Chris,

I'm abit confused
You are not the only one !!!

Because if i enter the slugs manually in VM product edit screen, they get saved nicely in the database, no error for duplicate slug
:silly:

So it is a weak point for CSVI?
Well it is the error from the database and not CSVI.

I am going to try these slugs manually and see what happens, I will let you know my findings. This has to be cleared up once and for all :)
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 8
Accepted Answer Pending Moderation
Thanks Roland,

Well it is the error from the database and not CSVI.


True, the database is correct to complain i think because CSVI is stripping the slug (while VM product edit function doesn't.)

I am going to try these slugs manually and see what happens...


Best way to go :)

Rgrds,
Chris
  1. more than a month ago
  2. RO CSVI
  3. # 9
Accepted Answer Pending Moderation
Hey Chris,

Eureka !!

i think because CSVI is stripping the slug (while VM product edit function doesn't.)
CSVI stripped the slug at the 192 character mark because that is the maximum length of the slug field. Now with your Russian characters, they are counted double and the length is reported longer than 192, This caused the last word to be dropped and in turn this caused the incorrect slug. So I removed the failsafe of the 192 characters, this is now up to the user to keep it within 192 characters.

As for VM doesn't strip the slug, VM doesn't even transliterate it in my case.

Attached is the patch file that removes the 192 length check.
Attachments (1)
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 10
Accepted Answer Pending Moderation
That's great Roland, problem solved! :laugh:

Just a note: the patch file gave an error: "No patch file has been provided" so i copied it manually, just in case there is an issue with the patch uploader.

Rgrds,
Chris
  1. more than a month ago
  2. RO CSVI
  3. # 11
Accepted Answer Pending Moderation
Chris,

You are the 3rd person to say that the patch can't be applied. I just realized that Joomla was telling me there was no new update but I was on version 3.4.3. So I updated Joomla and now I have version 3.4.4 and the loading of the patch file is broken !! Time to investigate.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 12
Accepted Answer Pending Moderation
Hey Chris,

The issue with the patch loader is because of a new security layer in Joomla, which doesn't allow the upload of php files. Will be fixed in the next release.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 13
Accepted Answer Pending Moderation
Ah yes, I had the problem with uploading the other day with some JCE plugins on a J3.4.4. site.
But I tried the patch earlier in a J3.4.3 site?
  1. more than a month ago
  2. RO CSVI
  3. # 14
Accepted Answer Pending Moderation
Are we talking about the same thing? The patch upload should still work on Joomla 3.4.3.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 15
Accepted Answer Pending Moderation
Sorry I confused the thread, by just mentioning that I had forgotten that I had run into a similar install issue a few days ago with a different 3.4.4 site

The patch upload didn't work for me earlier on the site I am testing which is 3.4.3 , but I manually installed it & the problem reported within this 1st thread is fixed.
This may be because the site is running on a staging environment in sitegorund?

I think were OK to assume this thread is resolved, thanks.
  1. more than a month ago
  2. RO CSVI
  3. # 16
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!