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

Next and previous links in blogs portlet dont work as expected



      When you view the details of a blogpost at the bottom there are next and previous links that allow you to navigate to the next and previous blog post

      In some cases these links not work as expected

      To reproduce :

      1. Place the blog portlet on a page in an empty community
      2. Create a blog with title blog 1 , set the display date to 1 sept 2011
      3. Create a blog with title blog 2 , set the display date to 3 sept 2011
      4. Create a blog with title blog 3 , set the display date to 2 sept 2011

      Now you will have a blog with 3 posts, blog 2 will be on top, entry 3 will be below it and logically should be the previous blog post

      5. Click on blog 2 to view the details
      6. Press the previous link on the bottom

      You will be redirected to blog 1, and not blog 3 as you would expect

      The problem lies in the getByG_S_PrevAndNext method of BlogsEntryPersitenceImpl. It will generate the following query to retrieve the previous post

      SELECT blogsEntry
      FROM BlogsEntry blogsEntry
      WHERE blogsEntry.groupId = ? AND blogsEntry.status = ? AND blogsEntry.displayDate <= ? AND blogsEntry.entryId <= ?
      ORDER BY blogsEntry.displayDate DESC, blogsEntry.entryId DESC

      The AND blogsEntry.entryId <= ? clause should not be there


          Issue Links



              luyang.tan Luyang Tan (Inactive)
              jelmer Jelmer Kuperus (Inactive)
              Participants of an Issue:
              Recent user:
              Esther Sanz
              0 Vote for this issue
              1 Start watching this issue


                Days since last comment:
                8 years, 18 weeks, 3 days ago


                  Version Package
                  6.0.X EE
                  --Sprint 12/11
                  6.1.0 CE RC1