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

core_course: Deprecated course_section_cm_availability does not return string

XMLWordPrintable

    • MOODLE_400_STABLE
    • MOODLE_400_STABLE
    • MDL-74160-master
    • Hide

      NOTE: this test is about deprecated methods so its normal to see many warning messages. even when you are not on a course page. For example, 3.11 course format causes a global deprecation message "Class 'format_base' has been renamed for the autoloader and is now deprecated".

      Prerequisites:

      1. Install the following third contrib formats:
        1. Collpased topics: https://moodle.org/plugins/format_topcoll
        2. One Topic: https://moodle.org/plugins/format_onetopic
        3. Buttons: https://moodle.org/plugins/format_buttons
      2. Enable debug messages (this can be done executing: mdk run mindev.php)
      3. Create a course and add an activity with a future date access restriction

      Test:

      1. Set the course format to collapsed topics.
      2. Check the course is displayed without any fatal error such as "Notice: Array to string conversion" (but plenty of warnings)
      3. Repeat the test with the other two formats (One topic and Buttons)
      Show
      NOTE : this test is about deprecated methods so its normal to see many warning messages. even when you are not on a course page. For example, 3.11 course format causes a global deprecation message "Class 'format_base' has been renamed for the autoloader and is now deprecated". Prerequisites: Install the following third contrib formats: Collpased topics: https://moodle.org/plugins/format_topcoll One Topic: https://moodle.org/plugins/format_onetopic Buttons: https://moodle.org/plugins/format_buttons Enable debug messages (this can be done executing: mdk run mindev.php) Create a course and add an activity with a future date access restriction Test: Set the course format to collapsed topics. Check the course is displayed without any fatal error such as "Notice: Array to string conversion" (but plenty of warnings) Repeat the test with the other two formats (One topic and Buttons)
    • Moppies Kanban

      In Moodle 4, the course/renderer.php has been deprecated by MDL-72656.

      While testing our custom format in Moodle 4, we get a fatal error because the function course_section_cm_availability (currently line 811) returns an array whereas it is defined to return a string, which previously it did.

      Expected behaviour would be for it to return a string (and show the deprecation warning).

        1. Screenshot 1.PNG
          106 kB
          Gladys Basiana
        2. Screenshot 2.PNG
          101 kB
          Gladys Basiana
        3. Screenshot 3.PNG
          90 kB
          Gladys Basiana

            tusefomal Ferran Recio
            quen Sam Marshall
            Carlos Escobedo Carlos Escobedo
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            Gladys Basiana Gladys Basiana
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours, 40 minutes
                3h 40m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.