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

Error during manual order state change #22322

Closed
Flower7C3 opened this issue Dec 9, 2020 · 11 comments
Closed

Error during manual order state change #22322

Flower7C3 opened this issue Dec 9, 2020 · 11 comments
Labels
1.7.7.0 Affects versions BO Category: Back Office Bug Type: Bug No change required Resolution: issue closed because expected as is Order Component: Which BO section is concerned

Comments

@Flower7C3
Copy link

Flower7C3 commented Dec 9, 2020

Describe the bug

When I manually change order state an error occurs:

[Symfony\Component\Debug\Exception\ContextErrorException kod 0]: Notice: Trying to get property 'id' of non-object

Expected behavior

Method \OrderCore::getCurrentOrderState:

public function getCurrentOrderState()
{
if ($this->current_state) {
return new OrderState($this->current_state);
}
return null;
}
should have following code:

    public function getCurrentOrderState()
    {
        if ($this->current_state !== "") {
            return new OrderState($this->current_state);
        }

        return null;
    }

Steps to Reproduce

Steps to reproduce the behavior:

  1. Go to orders list
  2. Change order status to cancelled
  3. See error on top

Additional information

  • PrestaShop version: 1.7.7.0
  • PHP version: 7.3.24
@hibatallahAouadni
Copy link
Contributor

Hello @Flower7C3

I didn't manage to reproduce your issue with PS1.7.7.0, see the attached screen record below:

https://drive.google.com/file/d/1Uf2yTmgH3G5R1s69W6CVLkUIQQYe29xU/view

Please check and feedback.

Thanks!

@hibatallahAouadni hibatallahAouadni added 1.7.7.0 Affects versions BO Category: Back Office Bug Type: Bug NMI Status: issue needs more information Order Component: Which BO section is concerned labels Dec 10, 2020
@Flower7C3
Copy link
Author

@hibatallahAouadni do You have same PHP version?

@hibatallahAouadni
Copy link
Contributor

hibatallahAouadni commented Dec 10, 2020

No my PHP version is 7.2 😅

@hibatallahAouadni
Copy link
Contributor

Hello @Flower7C3

Is this the error that you encountred?

image

Thanks for your feedback!

@Flower7C3
Copy link
Author

No, I have got other message:

[Symfony\Component\Debug\Exception\ContextErrorException kod 0]: Notice: Trying to get property 'id' of non-object

@hibatallahAouadni
Copy link
Contributor

Hello @Flower7C3

Did you change some Core files? Cause it seems your issue is not related neither to PS version nor PHP version.

Thanks!

@Flower7C3
Copy link
Author

I have changed classes/order/Order.php file as described in issue description.

@hibatallahAouadni
Copy link
Contributor

Hello @Flower7C3

You shouldn't change any of Core files! If you want to change some behavior of Core, you just need to override the Controller (see link).

So, I close the issue cause we use GitHub issues only to discuss about bugs and new features in the PrestaShop project. If you have questions about using PrestaShop or third-party modules, or if you need help with your shop, please consider one of our support plans.

Alternatively, you can also ask for help in the community forums or in the public Slack channel.

Thanks!

@hibatallahAouadni hibatallahAouadni added No change required Resolution: issue closed because expected as is and removed NMI Status: issue needs more information labels Dec 10, 2020
@rbeau
Copy link

rbeau commented Apr 27, 2021

Hi @Flower7C3,
Post #24097
I have same issue. Your bug is fixed ? Could you please explain me how to resolve this bug ? There is no change if I try your solution.
Thanks

@Flower7C3
Copy link
Author

Hi @rbeau, I have fixed this problem using overrides directory. All described in 1st comment #22322 (comment)

@rbeau
Copy link

rbeau commented Apr 29, 2021

You are right @Flower7C3 ,

I understand now, if I still turn Prestashop on mode debug solution doesn't work. Now debug mode is off and it work prefectely.

I thank you so much !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.7.7.0 Affects versions BO Category: Back Office Bug Type: Bug No change required Resolution: issue closed because expected as is Order Component: Which BO section is concerned
Projects
None yet
Development

No branches or pull requests

3 participants