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

IMPROVE [BO]: improve error msg on (install\uninstall) module in case of dirty Override files #29393

Open
2 tasks done
Tracked by #21426
ramtin2025 opened this issue Aug 19, 2022 · 5 comments
Open
2 tasks done
Tracked by #21426
Labels
1.7.7.0 Affects versions BO Category: Back Office Bug Type: Bug Minor Severity: minor bug > https://build.prestashop.com/news/severity-classification Module manager Label: Which BO under menu is concerned Modules Component: Which BO section is concerned Needs Specs Status: issue needs to be specified Verified The issue has been reproduced

Comments

@ramtin2025
Copy link
Contributor

Prerequisites

Describe the bug and add screenshots

The methods inside the overridden classes has special comments for identification.
If, for any reason, these comments are deleted or changes are made in them that cause identification problems, the installation or uninstallation process will have the following error:
"Exception thrown by module on "ModuleName" reset. Error when resetting module "ModuleName". Notice: Undefined offset: -1"
This error is completely incomprehensible and does not suggest any path to identify the problem.
Putting a condition before this line can help identify this error:
If ($line_number<5) { // some code to display error about override conflict }
PrestaShop github

Expected behavior

Exception thrown by module on "ModuleName" reset. Error when resetting module "ModuleName". Notice: Override/Classes/Product.php is dirty

Steps to reproduce

  1. Install a module that has an override
  2. Remove comments on overrided class
  3. Try to uninstall the above module

PrestaShop version(s) where the bug happened

1.7.8.5

PHP version(s) where the bug happened

7.4

If your bug is related to a module, specify its name and its version

No response

@ramtin2025 ramtin2025 added Bug Type: Bug New New issue not yet processed by QA labels Aug 19, 2022
@hibatallahAouadni
Copy link
Contributor

Hello @ramtin2025

Thanks for reporting the issue!
Could you please provide a test module to help me up reproducing the issue 🙏
Waiting for your feedback.

Thanks!

@hibatallahAouadni hibatallahAouadni added Waiting for author Status: action required, waiting for author feedback BO Category: Back Office NMI Status: issue needs more information Modules Component: Which BO section is concerned Module manager Label: Which BO under menu is concerned 1.7.8.5 Affects versions and removed New New issue not yet processed by QA labels Aug 19, 2022
@ramtin2025
Copy link
Contributor Author

Hello @ramtin2025

Thanks for reporting the issue! Could you please provide a test module to help me up reproducing the issue 🙏 Waiting for your feedback.

Thanks!

I attach a sample simple module with one overrided method in "Product.php" file.

  1. Install module
  2. Remove below lines from Root/override/classes/Product.php
    /*
    • module: test_override
    • date: 2022-- ::**
    • version: 1.0.0
      */
  3. Try to uninstall Module
    Note: Note that the "Product" class does not already have an override

test_override.zip

@prestashop-issue-bot prestashop-issue-bot bot removed the Waiting for author Status: action required, waiting for author feedback label Aug 20, 2022
@hibatallahAouadni
Copy link
Contributor

Hello @ramtin2025

Thanks for the module 🙏
I reproduce the issue with PS1786, PS1787 and PS80x see the attached screen record below:

issue_29393.mp4

While with PS1778, the module has been uninstalled without any error, so it's a regression on 1.7.8.0!
I’ll add this to the debug backlog so that it’s fixed.

Please be aware that due to the high number of reported issues, some bugs might take a very long time to be resolved. If this issue is important to you and you cannot wait for it to be fixed on the project’s own time, we strongly suggest you consider hiring a specialist to help you.

If you manage to get the problem fixed, then please contribute the fix back to the project as a Pull Request. Remember that the more people contribute, the better PrestaShop becomes for everyone.

Thank you

@hibatallahAouadni hibatallahAouadni added Minor Severity: minor bug > https://build.prestashop.com/news/severity-classification Needs Specs Status: issue needs to be specified Regression Type: regression Verified The issue has been reproduced and removed NMI Status: issue needs more information labels Aug 23, 2022
@ramtin2025
Copy link
Contributor Author

Hello @ramtin2025

Thanks for the module 🙏 I reproduce the issue with PS1786, PS1787 and PS80x see the attached screen record below:

issue_29393.mp4
While with PS1778, the module has been uninstalled without any error, so it's a regression on 1.7.8.0! I’ll add this to the debug backlog so that it’s fixed.

Please be aware that due to the high number of reported issues, some bugs might take a very long time to be resolved. If this issue is important to you and you cannot wait for it to be fixed on the project’s own time, we strongly suggest you consider hiring a specialist to help you.

If you manage to get the problem fixed, then please contribute the fix back to the project as a Pull Request. Remember that the more people contribute, the better PrestaShop becomes for everyone.

Thank you

Thank you.
Note that in the above example (provided test module), if you already have an override in a "product.php" class, an error will not be displayed. Of course, this does not mean that there is no problem, but the existence of a problem does not cause an error. Therefore, I am not sure that this problem does not exist in version 1.7.7.8 in your test.
I would like to help in solving this problem, but the collaboration process in GitHub is a bit difficult and time consuming. I'll try

@hibatallahAouadni
Copy link
Contributor

Hello @ramtin2025

Note that in the above example (provided test module), if you already have an override in a "product.php" class, an error will not be displayed. Of course, this does not mean that there is no problem, but the existence of a problem does not cause an error.
Therefore, I am not sure that this problem does not exist in version 1.7.7.8 in your test.

I confirm that while retesting the issue on a newly created shop 1.7.7.0, I reproduce the issue. So it's an old bug!

Thanks!

@hibatallahAouadni hibatallahAouadni added 1.7.7.0 Affects versions and removed Regression Type: regression 1.7.8.5 Affects versions labels Aug 23, 2022
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 Minor Severity: minor bug > https://build.prestashop.com/news/severity-classification Module manager Label: Which BO under menu is concerned Modules Component: Which BO section is concerned Needs Specs Status: issue needs to be specified Verified The issue has been reproduced
Projects
None yet
Development

No branches or pull requests

2 participants