Moodle
  1. Moodle
  2. MDL-26931

blog entries are ordered by modification date instead of creation date

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.2
    • Fix Version/s: 2.0.3
    • Component/s: Blog
    • Labels:
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE
    • Rank:
      16925

      Description

      If you add entires regularly, they are ordered by date, last entries on top. This is normal and perfectly acceptable. But if you discover an error in an old entry and edit it, upon saving it goes to the top, as if it were the last added one.

      In short: entries are ordered according to its modification date instead of its creation date, which leads to a lot of trouble if your entries are logically sequential as, for example, in a sequence of lecture's summaries (which is my case).

        Issue Links

          Activity

          Hide
          Orestes Mas added a comment -

          Maybe forum is also affected by this bug (see http://moodle.org/mod/forum/discuss.php?d=171559)

          Show
          Orestes Mas added a comment - Maybe forum is also affected by this bug (see http://moodle.org/mod/forum/discuss.php?d=171559 )
          Hide
          Helen Foster added a comment -

          Orestes, thanks for your report. You're right that blog entries should be ordered by creation date and not last modified date. The problem was fixed for 1.9.3 (MDL-12649) but seems to have crept back.

          Show
          Helen Foster added a comment - Orestes, thanks for your report. You're right that blog entries should be ordered by creation date and not last modified date. The problem was fixed for 1.9.3 ( MDL-12649 ) but seems to have crept back.
          Hide
          Ankit Agarwal added a comment -

          This issue is caused since the get_entries calls get_entry_fetch_sql with default ordering which is last modified.
          Hence this patch is a suggested fix for the same.

          Show
          Ankit Agarwal added a comment - This issue is caused since the get_entries calls get_entry_fetch_sql with default ordering which is last modified. Hence this patch is a suggested fix for the same.
          Hide
          David Mudrak added a comment -

          Hi Ankit. Thanks for the patch. It seems to be a correct solution (I assume you have tested it). Just a formal comment: according to Moodle coding style, we put one space character after comma in the list of a function parameters. Also, may I suggest that you fix your msysgit global configuration and set your name using capital letters and fill your email. It may sound as a pedantic whining but these details help to keep the code and commits readable and consistent.

          Show
          David Mudrak added a comment - Hi Ankit. Thanks for the patch. It seems to be a correct solution (I assume you have tested it). Just a formal comment: according to Moodle coding style, we put one space character after comma in the list of a function parameters. Also, may I suggest that you fix your msysgit global configuration and set your name using capital letters and fill your email. It may sound as a pedantic whining but these details help to keep the code and commits readable and consistent.
          Hide
          Ankit Agarwal added a comment -

          Hi David Mudrak.
          Yes i have tested the solution and is working fine.
          I will keep the suggestions you gave in mind.
          Thanks

          Show
          Ankit Agarwal added a comment - Hi David Mudrak. Yes i have tested the solution and is working fine. I will keep the suggestions you gave in mind. Thanks
          Hide
          David Mudrak added a comment -

          I have created pull requests to accept Ankit's patch. See the linked PULL issues.

          Show
          David Mudrak added a comment - I have created pull requests to accept Ankit's patch. See the linked PULL issues.
          Hide
          David Mudrak added a comment -

          INSTRUCTIONS FOR TESTING (difficulty: easy)

          1. make sure that blogging is enabled on your test site: Site administration > Advanced features > Blog visibility
          2. as a user, go to the Navigation > My profile > Blogs
          3. add a new entry to your blog
          4. add yet another entry to your blog
          5. edit the entry you added first
          6. TEST: make sure that the blog posts are still displayed in the order they were created

          Show
          David Mudrak added a comment - INSTRUCTIONS FOR TESTING (difficulty: easy) 1. make sure that blogging is enabled on your test site: Site administration > Advanced features > Blog visibility 2. as a user, go to the Navigation > My profile > Blogs 3. add a new entry to your blog 4. add yet another entry to your blog 5. edit the entry you added first 6. TEST: make sure that the blog posts are still displayed in the order they were created
          Hide
          Helen Foster added a comment -

          This issue is fixed in the latest 2.0.2+. Thanks everyone

          Show
          Helen Foster added a comment - This issue is fixed in the latest 2.0.2+. Thanks everyone

            People

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

              Dates

              • Created:
                Updated:
                Resolved: