-
Type:
Bug
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: 7.0.X, 7.1.X, 7.2.X, Master
-
Fix Version/s: 7.0.0 DXP FP86, 7.0.10.12 DXP SP12, 7.0.X, 7.1.10 DXP FP14, 7.1.X, 7.2.10 DXP FP1, 7.2.1 CE GA2, 7.2.X, 7.3.10 DXP GA1, Master
-
Component/s: ~[Archived] WCM
-
Branch Version/s:7.2.x, 7.1.x, 7.0.x
-
Backported to Branch:Committed
-
Fix Priority:4
-
Git Pull Request:
Reproduction steps:
- Create a web content
- Add a Web Content Display portlet to a page
- Display the content in the portlet and configure it to enable comments
- Click on the "Subscribe to comments" button
- Upgrade to Liferay 7.1
Experienced behavior: The classNameId is updated to JournalFolder's classNameId
Expected behavior: The classNameId should be JournalArticle's classNameId
Reproduced on master 912d7fabf61a8603d8ad67c716400ddda33b3cfb
Please see the doUpgrade() and the addClassName methods in the UpgradeSubscription class
@Override protected void doUpgrade() throws Exception { deleteOrphanedSubscriptions(); updateSubscriptionClassNames( Folder.class.getName(), DLFolder.class.getName()); updateSubscriptionClassNames( "com.liferay.portlet.journal.model.JournalArticle", "com.liferay.portlet.journal.model.JournalFolder"); updateSubscriptionGroupIds(); }
protected void addClassName(long classNameId, String className) throws Exception { try (PreparedStatement ps = connection.prepareStatement( "insert into ClassName_ (mvccVersion, classNameId, value) " + "values (?, ?, ?)")) { ps.setLong(1, 0); ps.setLong(2, classNameId); ps.setString(3, className); ps.executeUpdate(); } }