Jump to content

Issue after upgrade 1.7.8.3


Studio1one

Recommended Posts

HI,

Not sure if this will help you, but we had a similiar problem, after the upgrade you could access the actual website without a problem, but if you tried to access the BO it gave an error.

We got around this by making sure the site is not in Debug mode.

Edit /config/defines.inc.php - make sure the debug part is like below

/* Debug only */
if (!defined('_PS_MODE_DEV_')) {
define('_PS_MODE_DEV_', false);

Then delete the CACHE directory in the /VAR directory

Then try to access the BO again

Worked for us

Edited by cwiz (see edit history)
Link to comment
Share on other sites

58 minutes ago, Paul C said:

Have you check that the currencies are configured correctly? Looks like they got messed up in the transfer - probably because the id in the old shop doesn't match the id in the new.

Well, I was just trying to change in the new part of where I can change symbol and when i click save it made an error.
and it shows this on the currency page ( See image) Why does it say (Edited) ?

Skärmavbild 2022-02-20 kl. 12.40.05.jpg

Link to comment
Share on other sites

42 minutes ago, Studio1one said:

Well, I was just trying to change in the new part of where I can change symbol and when i click save it made an error.
and it shows this on the currency page ( See image) Why does it say (Edited) ?

Because those entries are different (have been modified) from default I guess. There's a column "modified" in the database (If you're using the default currencies it should be 0 and also a column "unofficial" that should also be 0). Because you haven't done an upgrade but have imported data it's quite easy to get things mismatched - assuming the source store had been modified from defaults in areas like currencies, taxes and languages. 

You could check entries in the configuration table too to make sure that things like the default tax, currency and language settings are correct. You could also have a mismatch in the default shop etc. so you might need to look at the configuration of the shop. It's very difficult to move parts of an old database to a clean install!

Link to comment
Share on other sites

11 minutes ago, RensR said:

Hi, U need validate if you have "Exchange Rate" in all currencies.
Also valid if the ID of your currencies are the same in both stores.

Well, when I tried to update the exchange rate I got this error message:

And also on my 1.7.6.8 version I do not see the ID number the way I see it on the 1.7.8.3 version.

Skärmavbild 2022-02-20 kl. 13.30.12.jpg

Link to comment
Share on other sites

You can just edit them in phpmyAdmin. I would make sure you set them all with "modified"=1 just in case. It shouldn't do any harm.... Also probably a good idea to clear the cache manually (remove var/cache/prod and/or var/cache/dev) after you have modified anything in phpmyadmin.

The bigger issue is that id_currency is referenced in lots of other tables. Some won't matter as they may be empty, others you have imported so they *should* match with what you've changed those to.

You can check the dependency on a PrestaShop column such as "id_currency" in other tables with:

 

SELECT
	*
FROM
	information_schema.columns
WHERE
	column_name = 'id_currency';

I think it should be consistent in naming throughout so that *should* get them all.....

Link to comment
Share on other sites

42 minutes ago, Paul C said:

You can just edit them in phpmyAdmin. I would make sure you set them all with "modified"=1 just in case. It shouldn't do any harm.... Also probably a good idea to clear the cache manually (remove var/cache/prod and/or var/cache/dev) after you have modified anything in phpmyadmin.

The bigger issue is that id_currency is referenced in lots of other tables. Some won't matter as they may be empty, others you have imported so they *should* match with what you've changed those to.

You can check the dependency on a PrestaShop column such as "id_currency" in other tables with:

 

SELECT
	*
FROM
	information_schema.columns
WHERE
	column_name = 'id_currency';

I think it should be consistent in naming throughout so that *should* get them all.....

But how to change the ID? If I change the NOK to number 3 as the old one is then it will be an error when I click "Run" because it's DKK column.
Im not a pro in PHP my admin but I could not run that question you wrote.

 

//P

Link to comment
Share on other sites

hace 1 hora, Studio1one dijo:

Pero, ¿cómo cambiar la identificación? Si cambio el NOK al número 3 como el anterior, será un error cuando haga clic en "Ejecutar" porque es la columna DKK.
No soy un profesional en PHP, mi administrador, pero no pude ejecutar la pregunta que escribiste.

 

//PAGS

Change them all to a high number, and then put the real IDs back in the correct order.

Link to comment
Share on other sites

Can you check if all your orders have the "id_currency" field assigned? In theory the error says that you are trying to use a function that needs "Total Value" and "Currency" but unfortunately currency is arriving empty. In the DB you can confirm this.

Link to comment
Share on other sites

1 hour ago, RensR said:

Can you check if all your orders have the "id_currency" field assigned? In theory the error says that you are trying to use a function that needs "Total Value" and "Currency" but unfortunately currency is arriving empty. In the DB you can confirm this.

If this is right it only show ( 0 ) in that table.

Skärmavbild 2022-02-20 kl. 18.34.51.jpg

Link to comment
Share on other sites

23 minutes ago, RensR said:

Can you check that orders in the old DB. Check if the id_currency is 0 too

I found that some Currency ID is wrong when I compare.

See image and there is two "0" the order 1802 should be ID 4 and order 1794 should be no 5 but both show 0.

How to fix that?

Skärmavbild 2022-02-20 kl. 19.05.45.jpg

Link to comment
Share on other sites

It is probably due to some error when you migrated the data, just correct the problem from the database, make sure there is no order with ID 0 or ID EMPTY. After fixing that problem in the DB you should already have your problem corrected. :)

Link to comment
Share on other sites

UPDATE ps_orders SET id_currency = 4 WHERE id_order = 1802;

UPDATE ps_orders SET id_currency = 5 WHERE id_order = 1794;



fter that run this query to check if there are no other orders with the same problem:
 

SELECT * FROM ps_orders where id_currency = 0

 

Edited by RensR (see edit history)
Link to comment
Share on other sites

6 minutes ago, RensR said:
UPDATE ps_orders SET id_currency = 4 WHERE id_order = 1802;

UPDATE ps_orders SET id_currency = 5 WHERE id_order = 1794;



fter that run this query to check if there are no other orders with the same problem:
 

SELECT * FROM ps_orders where id_currency = 0

 

Must be a better way?

Because it's 229 orders that is wrong.

Link to comment
Share on other sites

UPDATE `ps_orders` SET `id_currency` = 2 WHERE `id_currency` = 0;

You can do it like the above but that will set them all to "2" and that's possibly not correct! Have you looked at the ps_cart  table? If the currencies look OK in there then you could probably safely run a query to populate the orders with the same currency that the cart used. They may be corrupted too though.

IMPORTANT: Please also remember to take a backup before running SQL on the database that changes data. Then if it all goes wrong you can always go back to where you were before.

Edited by Paul C
Added DB warning (see edit history)
  • Like 1
Link to comment
Share on other sites

36 minutes ago, Paul C said:
UPDATE `ps_orders` SET `id_currency` = 2 WHERE `id_currency` = 0;

You can do it like the above but that will set them all to "2" and that's possibly not correct! Have you looked at the ps_cart  table? If the currencies look OK in there then you could probably safely run a query to populate the orders with the same currency that the cart used. They may be corrupted too though.

IMPORTANT: Please also remember to take a backup before running SQL on the database that changes data. Then if it all goes wrong you can always go back to where you were before.

No that will not be right because 0 shows on two different Languages and it shows the same in ps_cart

Link to comment
Share on other sites

7 minutes ago, Studio1one said:

No that will not be right because 0 shows on two different Languages and it shows the same in ps_cart

If id_lang can be linked to the currency that should be used, then you could use that field in your query. e.g. if people who use the language with id = 5 use currency with id = 5 then you could do:

UPDATE `ps_orders` SET `id_currency` = 5 WHERE `id_lang` = 5 AND id_currency = 0;

You would need to check the relationship between language and currency and then run the above for each language until all of the records with id_currency = 0 are gone.

It would appear that there are going to be other tables with id_currency incorrectly set though if both ps_orders and ps_cart are like that.

Edited by Paul C (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...