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

Increase maximum hook length to 191 characters #16176

Merged
merged 3 commits into from Nov 7, 2019

Conversation

@eternoendless
Copy link
Member

eternoendless commented Oct 29, 2019

Questions Answers
Branch? develop
Description? Hook names were unnecessarily fixed at a maximum of 64 characters, which could be especially problematic for hooks whose names are dynamically generated (see fixed issue). This change simply increases that limit to 191 (maximum allowed by utf8mb4).
Type? improvement
Category? CO
BC breaks? no
Deprecations? no
Fixed ticket? Fixes #16169
How to test? Install or update PS, then install a module that simply registers a hook like this: $this->registerHook('actionBeforeAjaxDieOrderControllerdisplayAjaxselectDeliveryOption')

This PR also fixes an invalid SQL statement in the update script.


This change is Reviewable

@eternoendless eternoendless added this to the 1.7.7.0 milestone Oct 29, 2019
@eternoendless eternoendless requested a review from PrestaShop/prestashop-core-developers as a code owner Oct 29, 2019
classes/Hook.php Outdated Show resolved Hide resolved
@eternoendless eternoendless dismissed stale reviews from jolelievre, atomiix, and Progi1984 via 61b47cc Nov 5, 2019
@eternoendless eternoendless changed the title Increase maximum hook length to 255 characters Increase maximum hook length to 191 characters Nov 5, 2019
@sarahdib

This comment has been minimized.

Copy link

sarahdib commented Nov 6, 2019

@eternoendless there is an error when I try to re-install the module with a long hook.
Capture d’écran 2019-11-06 à 16 44 33

@sarahdib sarahdib self-assigned this Nov 6, 2019
@sarahdib sarahdib added QA ✔️ and removed waiting for dev labels Nov 7, 2019
@PierreRambaud PierreRambaud merged commit a1a3849 into PrestaShop:develop Nov 7, 2019
2 checks passed
2 checks passed
PrettyCI Code formatting
Details
Travis CI - Pull Request Build Passed
Details
@PierreRambaud

This comment has been minimized.

Copy link
Contributor

PierreRambaud commented Nov 7, 2019

@eternoendless eternoendless deleted the eternoendless:fix-hook-size branch Nov 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.