Moodle
  1. Moodle
  2. MDL-33646

Display a message rather than an error when viewing an empty book

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 2.3.3
    • Component/s: Book
    • Labels:
    • Testing Instructions:
      Hide
      1. Goto a course and create a new book resource.
      2. Donot add any new chapters (Not even the first chapter)
      3. Login as student and access the book resource
      4. Make sure you get a notice msg but no error and backtrace is not generated
      5. Append something like &chapterid=5 to the url
      6. Make sure you get an error msg
      Show
      Goto a course and create a new book resource. Donot add any new chapters (Not even the first chapter) Login as student and access the book resource Make sure you get a notice msg but no error and backtrace is not generated Append something like &chapterid=5 to the url Make sure you get an error msg
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull Master Branch:
      MDL-33646-master
    • Rank:
      41637

      Description

      When a student accesses a book that does not yet have content, the following error message is displayed.

      Error reading chapter of book.
      
      More information about this error
      
      Debug info: 
      Error code: errorchapter
      Stack trace:
      line 467 of \lib\setuplib.php: moodle_exception thrown
      line 91 of \mod\book\view.php: call to print_error()
      

      It would be better if a message was displayed such as "No content has been added to this book yet."

        Issue Links

          Activity

          Hide
          Rossiani Wijaya added a comment -

          Reviewed the following:
          [Y] Syntax
          [Y] Output
          [Y] Whitespace
          [Y] Language
          [NA] Databases
          [Y] Testing
          [NA] Security
          [NA] Documentation
          [Y] Git
          [NA] Sanity check

          Reviewing this in 2.4. The patch works as expected.

          Show
          Rossiani Wijaya added a comment - Reviewed the following: [Y] Syntax [Y] Output [Y] Whitespace [Y] Language [NA] Databases [Y] Testing [NA] Security [NA] Documentation [Y] Git [NA] Sanity check Reviewing this in 2.4. The patch works as expected.
          Hide
          Ankit Agarwal added a comment -

          Thanks for the review Rosie.
          Sending for integration.

          Show
          Ankit Agarwal added a comment - Thanks for the review Rosie. Sending for integration.
          Hide
          Sam Hemelryk added a comment -

          Thanks Ankit, has been integrated now. As this is almost as much a bug fix as it is an improvement I've allowed it into 23 as well.

          Show
          Sam Hemelryk added a comment - Thanks Ankit, has been integrated now. As this is almost as much a bug fix as it is an improvement I've allowed it into 23 as well.
          Hide
          Andrew Davis added a comment -

          Works as described in master and 2.3. Passing.

          Show
          Andrew Davis added a comment - Works as described in master and 2.3. Passing.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          From somewhere within the clouds...

          Congrats, this has been sent upstream and is now part of Moodle (your favorite LMS platform). Many thanks for your awesome collaboration!

          Ciao

          Show
          Eloy Lafuente (stronk7) added a comment - From somewhere within the clouds... Congrats, this has been sent upstream and is now part of Moodle (your favorite LMS platform). Many thanks for your awesome collaboration! Ciao

            People

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

              Dates

              • Created:
                Updated:
                Resolved: