简体   繁体   中英

Update jquery version in Liferay 7.2

For security reasons, I need to update the version of jQuery in 7.2 Community edition of Liferay. It is currently using jQuery version 3.4 and I need to update to 3.5.

I have tried actually disabling jQuery in the control panel. I thought this might make 3.4 unavailable and I could then include a reference to 3.5 in my theme. However, disabling jQuery in the control panel broke the login form and control panel.

It would seem that a hook would be a good approach for this. I have found some info on 7.2 that allows you to override js functions but not the entire library.

How would you go about this?

jQuery 3.5.0 included a regression that causes panels within the control menu not being collapsed.
If you have access to fix packs, you can patch your Portal with fix pack 7 which will upgrade your jQuery to 3.5.1.
More info here:
https://issues.liferay.com/browse/LPS-114587
https://issues.liferay.com/browse/LPS-112136

If you don't have access to fix packs, here are the files where you need to change the jQuery version:
modules/apps/frontend-js/frontend-js-jquery-web/package.json
modules/yarn.lock

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM