Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delivery slips fails when upgrading to 1.7.5 #12626

Closed
rblaurin opened this issue Feb 13, 2019 · 9 comments
Closed

Delivery slips fails when upgrading to 1.7.5 #12626

rblaurin opened this issue Feb 13, 2019 · 9 comments
Labels
1.7.5.0 Affects versions Autoupgrade Module: autoupgrade BO Category: Back Office Delivery slip Label: Which BO under menu is concerned Fixed Resolution: issue closed because fixed
Milestone

Comments

@rblaurin
Copy link
Contributor

There is an issue when upgrading to 1.7.5.0 if you have only one language.
Here is a tutorial from @Matt75 to fix the issue:

If you have an error 500 on Orders > Delivery Slips with this error

Symfony\Component\Form\Exception\UnexpectedTypeException:
Expected argument of type "object, array or empty", "string" given

Execute this query

SELECT * FROM `ps_configuration_lang` WHERE `id_configuration` = (SELECT `id_configuration` FROM `ps_configuration` WHERE `name` LIKE 'PS_DELIVERY_PREFIX')

If no result, here is the issue.

So you can execute this query to create the language entry in ps_configuration_lang to solve the issue.

INSERT INTO `ps_configuration_lang` (`id_configuration`, `id_lang`, `value`) VALUES
(
	(SELECT `id_configuration` FROM `ps_configuration` WHERE `name` = 'PS_DELIVERY_PREFIX'),
	(SELECT `value` FROM `ps_configuration` WHERE `name` = 'PS_LANG_DEFAULT'),
	(SELECT `value` FROM `ps_configuration` WHERE `name` = 'PS_DELIVERY_PREFIX')
)

Of course you have to check if you use ps_ as table prefix before

In my opinion, something like the following code should be added to SQL upgrade script for 1.7.5.0:

INSERT INTO `ps_configuration_lang` (`id_configuration`, `id_lang`, `value`) VALUES
(
    SELECT
        `id_configuration`,
        (SELECT `value` FROM `ps_configuration` WHERE `name` = 'PS_LANG_DEFAULT'),
        `value`
    FROM `ps_configuration` c WHERE `name` = 'PS_DELIVERY_PREFIX'
    AND NOT EXISTS (SELECT 1 FROM `ps_configuration_lang` WHERE `id_configuration` = c.`id_configuration`)
)

Thanks in advance

@Quetzacoalt91 Quetzacoalt91 transferred this issue from PrestaShop/autoupgrade Feb 19, 2019
@Quetzacoalt91
Copy link
Member

This issue could be fixed with some changes added in the SQL files, that's why I moved it from the autoupgrade repository.

@khouloudbelguith
Copy link
Contributor

Hi @rblaurin,

Could you please provide me the exact language/country did you used during the installation of your previous PrestaShop.
Because as I said in my previous issue: #12535, I installed fresh PrestaShop 1.7.4.4 French language/ France country, I created a delivery slips => make an upgrade with the 1-click upgrade v4.5.1. => OK => I checked the Orders > Delivery Slips" page & it is OK.
Thanks!

@khouloudbelguith khouloudbelguith added BO Category: Back Office NMI Status: issue needs more information Delivery slip Label: Which BO under menu is concerned 1.7.5.0 Affects versions labels Feb 19, 2019
@rblaurin
Copy link
Contributor Author

Hi @khouloudbelguith,

I used Brazil / Brazilian Portuguese in my previous PrestaShop. I made a lot of updates since the first instalation (version 1.2, I think), so I don't know if this issue occurs for something remaining from a previous update, but it crashes only when updating to 1.7.5.
The way to reproduce this error is having a system with no "PS_DELIVERY_PREFIX" key in ps_configuration_lang table. But I don't know what version of Prestashop generated this deficiency.

@khouloudbelguith
Copy link
Contributor

@rblaurin, I tried to install PS1.7.0.0. with Brazil / Brazilian, I checked the table "ps_configuration"
image
And the ps_configuration_lang table, the "PS_DELIVERY_PREFIX" key exists
image
Thanks!

@rblaurin
Copy link
Contributor Author

rblaurin commented Feb 19, 2019

@Matt75 says in the issue #12535 that it seems to be related to upgrades from previous versions of Prestashop (1.6 he said).
As I mentioned before, I am not sure about what version introduced this deficiency in database. Looking at the SQL upgrade scripts, the only upgrade that seems to change the "PS_DELIVERY_PREFIX" key is to 1.1.0.1.
*** update: The sql upgrade script to 1.6.1.0 changes this key too. I am not sure if the bug could be related to this change.

@khouloudbelguith
Copy link
Contributor

Hi @rblaurin,

I tried with an old version 1.6.1.4, before the upgrade I checked the table "ps_configuration" and the ps_configuration_lang table, the "PS_DELIVERY_PREFIX" key exists.
I made an upgrade to PS1.7.5.0 & it is OK.
I attached a video record.
https://drive.google.com/file/d/1MfmIv3OnU2LTHyec8OeHFK5avatxmYQq/view
Despite our several trials, we could not reproduce your issue with the provided information.
It seems that your issue is not a PrestaShop's core bug but most likely a server configuration or customization problem.

Thanks!

@khouloudbelguith khouloudbelguith added Can't reproduce Resolution: issue closed because cannot be reproduced and removed NMI Status: issue needs more information labels Feb 20, 2019
@Matt75
Copy link
Contributor

Matt75 commented Feb 20, 2019

@khouloudbelguith In fact this problem occurs when you have a shop with only one language and your PrestaShop come from very old version. Maybe from < 1.5 but I'm not sure
So it seems to be an issue from PrestaShop previous version who impact database and not fixed with upgrade

There are many merchants with similar issue :

@khouloudbelguith
Copy link
Contributor

Hi @Matt75,

Thanks for your feedback.
@marionf what do you think?
Thanks!

@marionf
Copy link
Contributor

marionf commented Feb 20, 2019

It can be fixed in the autoupgrade module

@marionf marionf reopened this Feb 20, 2019
@marionf marionf added Ready Status: Issue is ready to be worked on Autoupgrade Module: autoupgrade and removed Can't reproduce Resolution: issue closed because cannot be reproduced labels Feb 20, 2019
@marionf marionf removed the Ready Status: Issue is ready to be worked on label Mar 1, 2019
@marionf marionf added this to Backlog in PrestaShop 1.7.6 via automation Mar 1, 2019
@marionf marionf moved this from Backlog to To be tested in PrestaShop 1.7.6 Mar 1, 2019
@marionf marionf added the Fixed Resolution: issue closed because fixed label Mar 4, 2019
@marionf marionf added this to the 1.7.6.0 milestone Mar 4, 2019
@marionf marionf moved this from To be tested to To be merged in PrestaShop 1.7.6 Mar 4, 2019
PierreRambaud added a commit that referenced this issue Mar 4, 2019
[IN] #12626 - Delivery slips fails when upgrading to 1.7.5
@marionf marionf closed this as completed Mar 4, 2019
PrestaShop 1.7.6 automation moved this from To be merged to Done Mar 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.7.5.0 Affects versions Autoupgrade Module: autoupgrade BO Category: Back Office Delivery slip Label: Which BO under menu is concerned Fixed Resolution: issue closed because fixed
Projects
No open projects
Development

No branches or pull requests

5 participants