Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-43411

showfromothers / hidefromothers error shown strings are not present but uses_sections is false

    Details

    • Testing Instructions:
      Hide
      • Open a course
      • Set the course format to 'Topics'
      • Toggle show/hide of a topic
        • Confirm that the alt/title text on the show/hide icon changes appropriately
      • Toggle it back
        • Confirm that the alt/title text on the show/hide icon changes appropriately
      • Confirm that drag/drop of activities and sections still works
      • Repeat with Weekly view
      • Edit course/format/weeks/lib.php:
        • Find the uses_sections() function and change it to return false
      • Refresh the course page
      • Toggle the show/hide section again
        • Confirm that the alt/title text is now a placeholder for a missing string
      • Confirm that you can no longer drag/drop move sections or resources*
      Show
      Open a course Set the course format to 'Topics' Toggle show/hide of a topic Confirm that the alt/title text on the show/hide icon changes appropriately Toggle it back Confirm that the alt/title text on the show/hide icon changes appropriately Confirm that drag/drop of activities and sections still works Repeat with Weekly view Edit course/format/weeks/lib.php: Find the uses_sections() function and change it to return false Refresh the course page Toggle the show/hide section again Confirm that the alt/title text is now a placeholder for a missing string Confirm that you can no longer drag/drop move sections or resources*
    • Affected Branches:
      MOODLE_24_STABLE, MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE, MOODLE_25_STABLE, MOODLE_26_STABLE
    • Pull Master Branch:
      MDL-43411-master
    • Sprint:
      FRONTEND Sprint 7
    • Story Points (Obsolete):
      5
    • Sprint:
      FRONTEND Sprint 7

      Description

      I have create a custom course format. In this format my uses_sections functions returns false. However, when I'm in turn on course editing I get the errors listed below.

      It seems that the strings are used by format/renderer.php when creating the icons for hiding and showing sections. However I see no check on this code to see if the format uses sections in the first place before throwing the error.

      Why should I need these strings if my format doesn't use sections.

      String does not exist. Please check your string definition for showfromothers/format_nosm_dashboard

      line 11423 of /lib/moodlelib.php: call to debugging()
      line 1088 of /lib/outputrequirementslib.php: call to lang_string->__construct()
      line 1124 of /lib/outputrequirementslib.php: call to page_requirements_manager->string_for_js()
      line 2998 of /course/lib.php: call to page_requirements_manager->strings_for_js()
      line 285 of /course/view.php: call to include_course_ajax()

      String does not exist. Please check your string definition for hidefromothers/format_nosm_dashboard

      line 11423 of /lib/moodlelib.php: call to debugging()
      line 1088 of /lib/outputrequirementslib.php: call to lang_string->__construct()
      line 1124 of /lib/outputrequirementslib.php: call to page_requirements_manager->string_for_js()
      line 2998 of /course/lib.php: call to page_requirements_manager->strings_for_js()
      line 285 of /course/view.php: call to include_course_ajax()

      Invalid get_string() identifier: 'showfromothers' or component 'format_nosm_dashboard'. Perhaps you are missing $string['showfromothers'] = ''; in /var/development/pge/moodle/mainline/course/format/nosm_dashboard/lang/en/format_nosm_dashboard.php?

      line 6913 of /lib/moodlelib.php: call to debugging()
      line 11451 of /lib/moodlelib.php: call to core_string_manager->get_string()
      line 11476 of /lib/moodlelib.php: call to lang_string->get_string()
      line 1423 of /lib/outputrequirementslib.php: call to lang_string->out()
      line 882 of /lib/outputrenderers.php: call to page_requirements_manager->get_end_code()
      line 287 of /course/view.php: call to core_renderer->footer()
      Invalid get_string() identifier: 'hidefromothers' or component 'format_nosm_dashboard'. Perhaps you are missing $string['hidefromothers'] = ''; in /var/development/pge/moodle/mainline/course/format/nosm_dashboard/lang/en/format_nosm_dashboard.php?

      line 6913 of /lib/moodlelib.php: call to debugging()
      line 11451 of /lib/moodlelib.php: call to core_string_manager->get_string()
      line 11476 of /lib/moodlelib.php: call to lang_string->get_string()
      line 1423 of /lib/outputrequirementslib.php: call to lang_string->out()
      line 882 of /lib/outputrenderers.php: call to page_requirements_manager->get_end_code()
      line 287 of /course/view.php: call to core_renderer->footer()

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            marina Marina Glancy added a comment -

            Thanks for the report Robert.
            It seems to be related to MDL-31096, passing to our AJAX/JS component lead.

            Andrew, I noticed lots of $courseid!=$SITE->id checks again instead of calling course_format_uses_sections() and course_ajax_enabled()
            We can't test it on any standard Moodle formats because we don't have any format that supports ajax but does not support sections at the same time.

            Show
            marina Marina Glancy added a comment - Thanks for the report Robert. It seems to be related to MDL-31096 , passing to our AJAX/JS component lead. Andrew, I noticed lots of $courseid!=$SITE->id checks again instead of calling course_format_uses_sections() and course_ajax_enabled() We can't test it on any standard Moodle formats because we don't have any format that supports ajax but does not support sections at the same time.
            Hide
            markn Mark Nelson added a comment -

            Andrew, looks spot on. Push for integration when you feel like it.

            Show
            markn Mark Nelson added a comment - Andrew, looks spot on. Push for integration when you feel like it.
            Hide
            dobedobedoh Andrew Nicols added a comment -

            Thanks Mark -
            Submitting for integratio

            Show
            dobedobedoh Andrew Nicols added a comment - Thanks Mark - Submitting for integratio
            Hide
            damyon Damyon Wiese added a comment -

            Noting that this seems to fix another bug, that drag and drop resources does not work on the front page.

            Show
            damyon Damyon Wiese added a comment - Noting that this seems to fix another bug, that drag and drop resources does not work on the front page.
            Hide
            damyon Damyon Wiese added a comment -

            Thanks Andrew,

            Integrated to 24, 25, 26 and master. (24 is a cherry-pick). I tested on 24 and it passes these instructions.

            Show
            damyon Damyon Wiese added a comment - Thanks Andrew, Integrated to 24, 25, 26 and master. (24 is a cherry-pick). I tested on 24 and it passes these instructions.
            Hide
            abgreeve Adrian Greeve added a comment -

            Tested on the 2.5, 2.6 and master integration branches.
            Works as described.
            Test passed.

            Show
            abgreeve Adrian Greeve added a comment - Tested on the 2.5, 2.6 and master integration branches. Works as described. Test passed.
            Hide
            marina Marina Glancy added a comment -

            Damyon, format "site" used on the frontpage does not support AJAX (I don't know why, it never did). AFAIK Andrew is working already on it in MDL-43167. But it should not have been changed in this issue, this is strange. Also there was another issue to change the icon: MDL-43164

            Show
            marina Marina Glancy added a comment - Damyon, format "site" used on the frontpage does not support AJAX (I don't know why, it never did). AFAIK Andrew is working already on it in MDL-43167 . But it should not have been changed in this issue, this is strange. Also there was another issue to change the icon: MDL-43164
            Hide
            damyon Damyon Wiese added a comment -

            David built a framework for behat
            At first just to test this and that
            10000+ steps written
            Sounds like we're all smitten
            And David should be smiling at that

            Thanks for reporting, patching, and testing this issue. It has been released upstream along with 64 others today.

            Show
            damyon Damyon Wiese added a comment - David built a framework for behat At first just to test this and that 10000+ steps written Sounds like we're all smitten And David should be smiling at that Thanks for reporting, patching, and testing this issue. It has been released upstream along with 64 others today.

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  13/Jan/14