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

Fix uninstalling modules with deleted hooks. #33802

Merged
merged 3 commits into from Sep 5, 2023

Conversation

Hlavtox
Copy link
Contributor

@Hlavtox Hlavtox commented Sep 1, 2023

Questions Answers
Branch? 8.1.x
Description? If a hook was removed from database, you can no longer uninstall a module or unhook it from there. The only change is basically adding a try catch, renaming a variable for better clarity and some comments.
Type? bug fix
Category? BO
BC breaks? no
Deprecations? no
How to test? See below
Fixed issue or discussion? Fixes #29483
Related PRs
Sponsor company

How to reproduce

  1. Install gsitemap native module. It adds a new hook gSitemapAppendUrls.
  2. Install this tox_hooktest.zip, it hooks itself to gSitemapAppendUrls.
  3. Uninstall gsitemap - it removes gSitemapAppendUrls.
  4. Try to uninstall the test module - Cannot Uninstall module tox_hooktest. The hook id #405 does not exist in database.

@Hlavtox Hlavtox requested a review from a team as a code owner September 1, 2023 13:40
@prestonBot
Copy link
Collaborator

Hi, thanks for this contribution!

I found some issues with the Pull Request description:

  • Your pull request does not seem to fix any issue, consider creating one (see note below) and linking it by writing Fixes #1234.

Would you mind having a look at it? This will help us understand how interesting your contribution is, thank you very much!

About linked issues

Please consider opening an issue before submitting a Pull Request:

  • If it's a bug fix, it helps maintainers verify that the bug is effectively due to a defect in the code, and that it hasn't been fixed already.
  • It can help trigger a discussion about the best implementation path before a single line of code is written.
  • It may lead the Core Product team to mark that issue as a priority, further attracting the maintainers' attention.

(Note: this is an automated message, but answering it will reach a real human)

@prestonBot prestonBot added 8.1.x Branch Bug fix Type: Bug fix labels Sep 1, 2023
classes/Hook.php Outdated Show resolved Hide resolved
classes/Hook.php Outdated Show resolved Hide resolved
kpodemski
kpodemski previously approved these changes Sep 1, 2023
classes/Hook.php Outdated Show resolved Hide resolved
Co-authored-by: PululuK <pululuandre@hotmail.com>
Copy link
Member

@boherm boherm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @Hlavtox!

@ps-jarvis ps-jarvis added the Waiting for QA Status: action required, waiting for test feedback label Sep 4, 2023
Copy link
Contributor

@jolelievre jolelievre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Hlavtox

@MhiriFaten MhiriFaten self-assigned this Sep 4, 2023
Copy link

@MhiriFaten MhiriFaten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @Hlavtox ,

I have checked your PR and the uninstalling modules with deleted hooks problem is fixed.
Automated tests are OK.

@MhiriFaten MhiriFaten added QA ✔️ Status: check done, code approved and removed Waiting for QA Status: action required, waiting for test feedback labels Sep 4, 2023
@prestonBot
Copy link
Collaborator

QA approved, well done! Message to the maintainers: do not forget to milestone it before the merge.

@nicosomb nicosomb added this to the 8.1.2 milestone Sep 5, 2023
@nicosomb nicosomb merged commit eb85a0f into PrestaShop:8.1.x Sep 5, 2023
38 checks passed
@nicosomb
Copy link
Contributor

nicosomb commented Sep 5, 2023

Thank you @Hlavtox

@Hlavtox Hlavtox deleted the fix-module-uninstall branch September 5, 2023 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.1.x Branch Bug fix Type: Bug fix QA ✔️ Status: check done, code approved
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

10 participants