News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Sql errors on updating country list with version 3.8.9.10592-3.8.9.10602

Started by Milbo, March 09, 2022, 11:33:16 AM

Previous topic - Next topic

Milbo

The new installer has an updater for the Country list to update it according to ISO 3166 with num_codes.

I did a small mistake, the sql file for the freshinstallation was also executed. The sql file is without ids, light as possible, so it just adds all the countries again. Stupidly before the table were changed/adjusted. So the new uniques are not there. Then the keys got added and after that the updater for the country list runs and tries to add the num_codes. It breaks then, because the entries are doubled, and so the new unique key prevents updating them.

The problem is now fixed, but if you already updated, you get in trouble due doubled country entries. The easiest way is to go to the country list, sort them by id, set the list on 400 pieces and just deleted the doubled entries manually. The normal entries go up to id 249. Then use com_virtuemart.3.8.9.10602_pack and the fresh uploaded https://dev.virtuemart.net/attachments/1303/com_virtuemart.3.8.9.10607_package_or_extract.zip
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

pinochico

Since when do developers leave visible installations with an error with the manual how to fix the application?

I have not seen this practice anywhere in any application for the web or apple.

Simple solution - delete from the system and release the correct version - please do not burden the others with your mistakes, please.
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

diri

Quote from: Milbo on March 09, 2022, 11:33:16 AM
The new installer has an updater for the Country list to update it according to ISO 3166 with num_codes.

I did a small mistake, the sql file for the freshinstallation was also executed. The sql file is without ids, light as possible, so it just adds all the countries again. Stupidly before the table were changed/adjusted. So the new uniques are not there. Then the keys got added and after that the updater for the country list runs and tries to add the num_codes. It breaks then, because the entries are doubled, and so the new unique key prevents updating them.

The problem is now fixed, but if you already updated, you get in trouble due doubled country entries. The easiest way is to go to the country list, sort them by id, set the list on 400 pieces and just deleted the doubled entries manually. The normal entries go up to id 249. Then use com_virtuemart.3.8.9.10602_pack and the fresh uploaded https://dev.virtuemart.net/attachments/1303/com_virtuemart.3.8.9.10607_package_or_extract.zip
I fear it's not fixed:

06:10:23',`created_by`='62',`modified_on`='2022-03-10 06:10:23',`modified_by`='62' WHERE `virtuemart_country_id` = '196'
vmError: vmTable store updateObject Duplicate entry '729' for key 'country_num_code' UPDATE `xyz_virtuemart_countries` SET `virtuemart_worldzone_id`='1',`country_name`='Sudan the',`country_3_code`='SDN',`country_2_code`='SD',`country_num_code`='729',`ordering`='0',`published`='1',`created_on`='2022-03-10 06:10:23',`created_by`='62',`modified_on`='2022-03-10 06:10:23',`modified_by`='62' WHERE `virtuemart_country_id` = '199'

diri

Didn't try it again but:
AFAICS last valid country_id seems to be 248, not 249. 249 would be Afghanistan which has id 1.

IN VM's admin interface you can not delete an entry. Unpublish is most powerfull choice.

pinochico

QuoteIN VM's admin interface you can not delete an entry.

of course if DEV team create unfunction installation :))))
You have to go to DB table and change inside self
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

sirius

By my side
Not so hard to find which ones are extra, since the created_on, modified_on and locked_on are with NULL instead of a date
Quote from: Milbo on March 09, 2022, 11:33:16 AM
The new installer has an updater for the Country list to update it according to ISO 3166 with num_codes.

I did a small mistake, the sql file for the freshinstallation was also executed. The sql file is without ids, light as possible, so it just adds all the countries again. Stupidly before the table were changed/adjusted. So the new uniques are not there. Then the keys got added and after that the updater for the country list runs and tries to add the num_codes. It breaks then, because the entries are doubled, and so the new unique key prevents updating them.

The problem is now fixed, but if you already updated, you get in trouble due doubled country entries. The easiest way is to go to the country list, sort them by id, set the list on 400 pieces and just deleted the doubled entries manually. The normal entries go up to id 249. Then use com_virtuemart.3.8.9.10602_pack and the fresh uploaded https://dev.virtuemart.net/attachments/1303/com_virtuemart.3.8.9.10607_package_or_extract.zip

The method works perfectly and took me one minute
J3.10.12 | PHP 7.4.33 + APC + Opcode
VM Prod : 3.8.6 | VM Test : 4.4.0.11095

pinochico

QuoteThe method works perfectly and took me one minute

of course, for me to :)
but for my client or client type dummy not.... == is not justification for unfuction installation and this post

sorry discussion is about nothing :)
Delete instalation file, change and put new without error to VM download system and go on :)
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

Milbo

The problem was deeper within the country cache system. Furthermore we removed years ago deletion of countries, because was always enough to just unpublish them.

I really worked hart for this new updater considering also broken updates, as best as possible. The new updater uses a country sql with the old ids, it deletes all countries with -1 in the name to remove doubled once.

There are also other fixes for j4 and so on. new FE template (BS3) and more. https://dev.virtuemart.net/projects/virtuemart/repository

https://dev.virtuemart.net/attachments/1304/com_virtuemart.3.8.9.10619_package_or_extract.zip

Pinochico, I removed the last file,... but the tone of your comments is not really helpful.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/