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

JournalArticleLocalServiceImpl.copyArticle does not create a valid urlTitle for the copy

    Details

    • Branch Version/s:
      6.1.x
    • Backported to Branch:
      Committed

      Description

      JournalArticleLocalServiceImpl.copyArticle leaves the urlTitle of the copy null. This breaks display urls if the copied article had a display page set.

        Issue Links

          Activity

          Hide
          mbisanz Martin Bisanz (Inactive) added a comment -

          Suggested fix:

          Add the following line to JournalArticleLocalServiceImpl.copyArticle:

          newArticle.setTitle(oldArticle.getTitle());
          // BugFix: set a valid urlTitle
          newArticle.setUrlTitle(getUniqueUrlTitle(id, groupId, newArticleId, oldArticle.getTitle()));
          newArticle.setDescription(oldArticle.getDescription());

          Show
          mbisanz Martin Bisanz (Inactive) added a comment - Suggested fix: Add the following line to JournalArticleLocalServiceImpl.copyArticle: newArticle.setTitle(oldArticle.getTitle()); // BugFix: set a valid urlTitle newArticle.setUrlTitle(getUniqueUrlTitle(id, groupId, newArticleId, oldArticle.getTitle())); newArticle.setDescription(oldArticle.getDescription());
          Hide
          mbisanz Martin Bisanz (Inactive) added a comment -

          Suggested fix (corrected):

          Add the following line to JournalArticleLocalServiceImpl.copyArticle:

          newArticle.setTitle(oldArticle.getTitle());
          // BugFix: set a valid urlTitle
          newArticle.setUrlTitle(getUniqueUrlTitle(id, groupId, newArticleId, oldArticle.getTitleCurrentValue()));
          newArticle.setDescription(oldArticle.getDescription());

          Show
          mbisanz Martin Bisanz (Inactive) added a comment - Suggested fix (corrected): Add the following line to JournalArticleLocalServiceImpl.copyArticle: newArticle.setTitle(oldArticle.getTitle()); // BugFix: set a valid urlTitle newArticle.setUrlTitle(getUniqueUrlTitle(id, groupId, newArticleId, oldArticle.getTitleCurrentValue())); newArticle.setDescription(oldArticle.getDescription());
          Hide
          mika.koivisto Mika Koivisto added a comment -

          Thanks Martin

          Show
          mika.koivisto Mika Koivisto added a comment - Thanks Martin
          Hide
          michael.saechang Michael Saechang added a comment -

          Committed on:
          Portal 6.2.x GIT ID: 0bc035b955f31fef7834b3f6a74656695721eb10.

          Show
          michael.saechang Michael Saechang added a comment - Committed on: Portal 6.2.x GIT ID: 0bc035b955f31fef7834b3f6a74656695721eb10.
          Hide
          sophia.zhang Sophia Zhang added a comment -

          PASSED Manual Testing using the following steps:

          1. Add new page
          2. Add Asset Publisher to the page.
          3. Go to Configuration -> Display Settings, flag the checkbox for Set as the Default Asset Publisher for This Page.
          4. Go to control panel and create a web content and set the display page of that content to the page with the asset publisher and publish it.
          5. Then using the Copy action create a copy of the just created web content
          6. Go back to the asset publisher page and click both of the articles.

          Fixed on:
          Tomcat 7.0 + MySQL 5. Portal 6.1.x EE GIT ID: 8f37f9f4f2eba7e35f5e101c04d74716792042a9.
          Tomcat 7.0 + MySQL 5. Portal 6.2.x GIT ID: c8fc08e37c9246c5d2fa8181c5c2dffa38705f9f.

          The arrticles display correctly in the default Asset Publisher page.

          Unable to reproduce it since before the fix there is no feature for #3.

          Show
          sophia.zhang Sophia Zhang added a comment - PASSED Manual Testing using the following steps: 1. Add new page 2. Add Asset Publisher to the page. 3. Go to Configuration -> Display Settings, flag the checkbox for Set as the Default Asset Publisher for This Page . 4. Go to control panel and create a web content and set the display page of that content to the page with the asset publisher and publish it. 5. Then using the Copy action create a copy of the just created web content 6. Go back to the asset publisher page and click both of the articles. Fixed on: Tomcat 7.0 + MySQL 5. Portal 6.1.x EE GIT ID: 8f37f9f4f2eba7e35f5e101c04d74716792042a9. Tomcat 7.0 + MySQL 5. Portal 6.2.x GIT ID: c8fc08e37c9246c5d2fa8181c5c2dffa38705f9f. The arrticles display correctly in the default Asset Publisher page. Unable to reproduce it since before the fix there is no feature for #3.

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                3 years, 44 weeks, 3 days ago

                Development

                  Subcomponents