-
Type:
Bug
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: 6.2.X EE, 7.0.X EE, Master
-
Fix Version/s: 7.0.0 DXP FP26, 7.0.X EE, 7.0.4 CE GA5, 7.1.X, Master
-
Component/s: Calendar > Upgrade
-
Branch Version/s:7.0.x
-
Backported to Branch:Committed
-
Story Points:1.5
-
Fix Priority:3
-
Git Pull Request:
Description
During LPS-54630, it was decided that no Calendars of type group should have the userId of the default user. An upgrade process was added to modify the userId of any calendar having the default userId to the userId of an admin user. However, the method fails to work properly because the upgrade process runs the methods in the wrong order.
Steps to Reproduce
1. Start up Liferay 6.2
2. Deploy a revision of the calendar-portlet plugin that does not have LPS-54630 committed (I used 94aa0f393a308703c4dceb2b02133d7850e92ae2).
3. Add a calendar portlet to a page.
4. Shut down the portal.
5. Configure your Liferay 7 bundle's upgrade properties to point to your database.
6. Run the upgrade.
7. After the upgrade completes, run the following query against the database:
SELECT * FROM Calendar INNER JOIN User_ ON (Calendar.userId = User_.userId) INNER JOIN CalendarResource ON Calendar.calendarResourceId = CalendarResource.calendarResourceId INNER JOIN ClassName_ ON CalendarResource.classNameId = ClassName_.classNameId WHERE (ClassName_.value = 'com.liferay.portal.kernel.model.Group') AND (User_.defaultUser = 1)
Expected Result: The above query would return no results.
Actual Result: The above query returns a result.
Reproduced in master (02a5802cdbf4bd383b3aae71f3752d6ebb5b84e2)
Reproduced in ee-7.0.x (7b03a2a1a288654913fb09182ed1e1e0c49d236a)
Reproduced in ee-6.2.x (Plugins Repo Id 3b170681ad7e517d7c6137f29d026b44780d6ad8) NOTE: To test in ee-6.2.x, just upgrade to the latest revision of the calendar-portlet plugin, rather than upgrading the entire portal. Also, in the SQL query from step 6, replace 'com.liferay.portal.kernel.model.Group' with 'com.liferay.portal.model.Group'.