Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-98556

Incorrect classname is used for journal article subscriptions after upgrading to 7.1

    Details

      Description

      Reproduction steps:

      1. Create a web content
      2. Add a Web Content Display portlet to a page
      3. Display the content in the portlet and configure it to enable comments
      4. Click on the "Subscribe to comments" button
      5. 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();
      		}
      	}

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                15 weeks, 6 days ago

                Packages

                Version Package
                7.0.0 DXP FP86
                7.0.X
                7.1.10 DXP FP14
                7.1.X
                7.2.10 DXP FP1
                7.2.X
                7.2.1 CE GA2
                Master