5.0 Breaking Changes Guide
When upgrading to 5.0, there are some breaking changes that need to be accounted for.
Only errors need to be handled as a part of the upgrade. Warnings do not need to be addressed at this time.
Remove legacy com.psddev AI and search dependencies
The AI and search plugin architecture has been rearchitected under com.brightspot.ai and com.brightspot.db. The following legacy dependencies must be removed from all modules to prevent classpath conflicts:
com.psddev:ai-chatcom.psddev:dari-aicom.psddev:dari-ai-dbcom.psddev:openaicom.psddev:opensearchcom.psddev:solr-aicom.psddev:dari-solrcom.psddev:dari-solr-v6
Remove both direct and transitive usages. See the Adding 5.0 Features Guide for the replacement dependencies and setup instructions.
Remove API com.psddev:conversation
The functionality of this module has been migrated to com.psddev:cms-db. Remove com.psddev:conversation from your dependencies.
Changes due to deprecation of ToolPage and ToolPageContext
The following changes are required because ToolPage and ToolPageContext have been deprecated from the platform. Since we are overriding/extending these classes/methods, materialized files need to be updated accordingly.
Remove ToolPageContext from method arguments
If you have overridden any platform method that included ToolPageContext as a parameter, and it is not used in the method body, simply remove it. Ensure that the method signature matches the updated platform signature.
Replace MockHttpServletRequest usage with MockWebRequest
If your tests contain code using MockHttpServletRequest, replace it with MockWebRequest.
Before:
1MockHttpServletRequest request = new MockHttpServletRequest();2request.setAttribute(PageFilter.SITE_CHECKED_ATTRIBUTE, Boolean.TRUE);3request.setAttribute(PageFilter.SITE_ATTRIBUTE, site);4request.setParameter("paramName", "paramValue");
After:
1private static WebRequestOverride override;23MockWebRequest mockRequest = new MockWebRequest();4mockRequest.as(PageRequest.class).setCurrentSite(site);5mockRequest.setParameter("paramName", "paramValue");67override = WebRequest.override(mockRequest);
Replace HttpServletRequest usage with WebRequest
-
Any usage of
PageFilter.SITE_CHECKED_ATTRIBUTEorPageFilter.SITE_ATTRIBUTEneeds to be replaced withWebRequestin application code andMockWebRequestin test code.Before:
1Site currentSite = PageFilter.Static.getSite(request);After:
1WebRequest request = WebRequest.getCurrent();2Site currentSite = request.as(PageRequest.class).getCurrentSite(); -
If any method uses
HttpServletRequestas a parameter, remove it from the method argument and useWebRequestinstead.Before:
1public String getRecipientEmail(HttpServletRequest request, HttpServletResponse response, Form form) {23}After:
1public String getRecipientEmail(HttpServletResponse response, Form form) {2if (!WebRequest.isAvailable()) {3return null;4}5WebRequest request = WebRequest.getCurrent();6}