Uploaded image for project: 'Moodle app'
  1. Moodle app
  2. MOBILE-1992

Page module description doesn't display in mobile app

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 3.1.3
    • Fix Version/s: None
    • Component/s: Page add-on
    • Labels:
    • Affected Branches:
      MOODLE_31_STABLE

      Description

      In page module, when a page description is not empty, it should be displayed when people clicked to view the page, it works fine in website, description is displayed in the page, but it doesn't display in mobile app. When the description contains video or something else important, it could be a malfunction, because the inconsistency between web and mobile app and missed out the infomation.

      I did some research about this.
      1.Checked with core_course_get_contents API, found that no description returned in the module area.
      2.Edit the module in website, make sure Appearance->Display page description is ticked.
      3.Putted a lot of effort to look into the code, start from the core_course_get_contents method, tracked down to page_get_coursemodule_info in ~/moodle/mod/page/lib.php found the real problem. There is nothing to do with $printintro which should be combined with $coursemodule->showdescription to determine whether to passed $info->content(the description) to the caller.

      To conclude,
      The really problem is it doesn't put description into the API result when $printintro doesn't play a role.
      To correct it, write like this in page_get_coursemodule_info method:
      if ($coursemodule->showdescription || $printintro)

      { // Convert intro to html. Do not filter cached version, filters run at display time. $info->content = format_module_intro('page', $page, $coursemodule->id, false); $info->showdescription = true; }

      Maybe it's just a walk around, but it do solved the problem, if there's a better way please kindly to point out.
      I really hope in next version, the problem could be solved, thanks in advance, cheers.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              zac_qin Zac Qin
              Participants:
              Component watchers:
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: