Skip to main content

5.0 Breaking Changes Guide

When upgrading to 5.0, there are some breaking changes that need to be accounted for.

Note

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-chat
  • com.psddev:dari-ai
  • com.psddev:dari-ai-db
  • com.psddev:openai
  • com.psddev:opensearch
  • com.psddev:solr-ai
  • com.psddev:dari-solr
  • com.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:

1
MockHttpServletRequest request = new MockHttpServletRequest();
2
request.setAttribute(PageFilter.SITE_CHECKED_ATTRIBUTE, Boolean.TRUE);
3
request.setAttribute(PageFilter.SITE_ATTRIBUTE, site);
4
request.setParameter("paramName", "paramValue");

After:

1
private static WebRequestOverride override;
2
3
MockWebRequest mockRequest = new MockWebRequest();
4
mockRequest.as(PageRequest.class).setCurrentSite(site);
5
mockRequest.setParameter("paramName", "paramValue");
6
7
override = WebRequest.override(mockRequest);

Replace HttpServletRequest usage with WebRequest

  1. Any usage of PageFilter.SITE_CHECKED_ATTRIBUTE or PageFilter.SITE_ATTRIBUTE needs to be replaced with WebRequest in application code and MockWebRequest in test code.

    Before:

    1
    Site currentSite = PageFilter.Static.getSite(request);

    After:

    1
    WebRequest request = WebRequest.getCurrent();
    2
    Site currentSite = request.as(PageRequest.class).getCurrentSite();
  2. If any method uses HttpServletRequest as a parameter, remove it from the method argument and use WebRequest instead.

    Before:

    1
    public String getRecipientEmail(HttpServletRequest request, HttpServletResponse response, Form form) {
    2
    3
    }

    After:

    1
    public String getRecipientEmail(HttpServletResponse response, Form form) {
    2
    if (!WebRequest.isAvailable()) {
    3
    return null;
    4
    }
    5
    WebRequest request = WebRequest.getCurrent();
    6
    }

Was this page helpful?

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.