-
Notifications
You must be signed in to change notification settings - Fork 122
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
Add new hooks in sql upgrade statement #1168
base: dev
Are you sure you want to change the base?
Conversation
tleon
commented
Feb 11, 2025
Questions | Answers |
---|---|
Description? | Added the new hooks from 9.0.x to the sql upgrade statement |
Type? | improvement |
BC breaks? | no |
Deprecations? | no |
Fixed ticket? | Fixes #37163 |
Sponsor company | PrestaShop SA |
How to test? | CI green |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tleon I think you should update the part that @jolelievre added in his previous PR, because, for example, the part deleting the hooks is identical
c700bd9
to
3a0027e
Compare
|
(NULL, 'dashboardData', '', '', '1'), | ||
(NULL, 'actionPasswordRenew', '', '', '1'), | ||
(NULL, 'actionDownloadAttachment', '', '', '1'), | ||
(NULL, 'fooHook', '', '', '1'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there really a hook with this name in production?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, this is the same problem as with the generated docs, some of the hooks should be excluded, I added more comments on this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the end i don't know anymore if this command is a good idea i'm a but tired of all of this :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tleon I understand you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is a good idea and it works great, the most important remaining thing is to have block-list of hooks available, so you don't generate them, hooks from tests
directory, and hooks that are deprecated :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of a s list of blocked hooks we could have instead a list of folders that the scanner shouldn't scan
How will users be able to use hooks without them having a description ? |
@@ -323,3 +323,106 @@ ALTER TABLE `PREFIX_attachment_lang` MODIFY COLUMN `name` varchar(255) DEFAULT N | |||
/* Fix category thumbnail images */ | |||
/* https://github.com/PrestaShop/PrestaShop/pull/36877 */ | |||
/* PHP:ps_900_migrate_category_images(); */; | |||
|
|||
/* Auto generated hooks added for version 9.0.0 */ | |||
INSERT INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`, `position`) VALUES |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Be careful the list of inserted hooks is already upper in this file The command is able to generate the SQL query but it cannot modify this file "in place", it only appends the content at the end So we need to manually keep the file consistent (either move this added code upper in the file or remove the upper part)