Problem/Motivation
There are modules that WxT has added as dependencies in info files but when these were added, there was no update hook to install the module. The result is that after a site gets updated, it could have modules that are dependencies that are not installed.
Dependencies of wxt: jquery_ui_resizable
Dependencies of wxt_ext_editor: ckeditor_abbreviation, ckeditor_details, footnotes, toc_api, toc_filter, wxt_ext_media_image_responsive
Proposed resolution
Add an update hook to install these modules.
Remaining tasks
Implement.
User interface changes
None.
API changes
None.
Data model changes
None.
Comments
Comment #2
web247 commentedComment #3
web247 commentedI added a small patch that implements an update hook to install the dependencies, please review.
Comment #4
web247 commentedComment #5
smulvih2@web247 this should be an install hook for the wxt_ext_editor module, then you can remove the check for the wxt_ext_editor module. Also not sure if we should check if the individual modules are already installed or not before trying to install them, please let me know after testing this. Thanks!
Comment #6
web247 commentedThanks @smulvih2 , I addressed your feedback and created another patch for that, tested and I verified that the modules were installed. Kindly review.
Comment #7
web247 commentedComment #9
liam morlandI made a merge request with the patches in #3 and #6.
Comment #10
smulvih2I don't think we need this logic in a hook_install() since the .info file will take care of that when installing the module. I think the issue is only when upgrading and wxt_ext_editor is already enabled, so this should be done in a hook_update() in wxt_ext_editor. Since jquery_ui_resizable is a dependency of wxt itself, this one module could be installed via a hook_update() in the wxt_core module. This way if a site is not using wxt_ext_editor, only the one module will be installed.
Also, the two arrays and switch statement could probably be replaced with something like this (not tested):
Comment #11
web247 commentedI added a new patch which addresses the last suggestions above (couldn't push the changes to the MR for some reason), tested it as well on a WxT 6.1.4 instance.
Comment #12
web247 commentedComment #13
liam morland@web247 did you click on "Get push access"? You will need to do that before you can push.
Comment #14
web247 commentedI did and I still have the same error:
I'll submit patches for now (sorry).
Comment #15
smulvih2@web247 thanks for updating the patch, changes look good! Will merge this in for the next 6.1.x release.
Comment #16
smulvih2Small fix to patch #11, changed
$module_handler->moduleExists($m)with$moduleHandler->moduleExists($m)to prevent error on drush updb.Comment #17
smulvih2This has been merged with 6.1.x and will be available in 6.1.5.