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

Warning: count(): Parameter must be an array or an object that implements Countable in mod/lesson/import_form.php on line 72

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.7
    • Fix Version/s: 3.6.5, 3.7.1
    • Component/s: Lesson
    • Labels:
    • Testing Instructions:
      Hide

      PHP 7.2 is required.

      Lesson:

      1. Log in as admin and create a course (or use an existing course)
      2. Go into the course and turn the editing mode on, and then add a lesson activity to the course (just enter a name and leave other fields to their default values)
      3. Go to the lesson activity and click on the "Import questions" link
      4. Click on the "Import" button without uploading any file
      5. Verify that you see a form validation message saying the file field is required
      6. Verify that no error is displayed on the page

      Question:

      1. Log in as admin and create a course (or use an existing course)
      2. Go into the course. Then click on the cog icon and then follow "More... > Question bank > Import"
      3. Click on the "Import" button without uploading any file
      4. Verify that you see a form validation message saying the file field is required
      5. Verify that no error is displayed on the page
      Show
      PHP 7.2 is required. Lesson: Log in as admin and create a course (or use an existing course) Go into the course and turn the editing mode on, and then add a lesson activity to the course (just enter a name and leave other fields to their default values) Go to the lesson activity and click on the "Import questions" link Click on the "Import" button without uploading any file Verify that you see a form validation message saying the file field is required Verify that no error is displayed on the page Question: Log in as admin and create a course (or use an existing course) Go into the course. Then click on the cog icon and then follow "More... > Question bank > Import" Click on the "Import" button without uploading any file Verify that you see a form validation message saying the file field is required Verify that no error is displayed on the page
    • Affected Branches:
      MOODLE_37_STABLE
    • Fixed Branches:
      MOODLE_36_STABLE, MOODLE_37_STABLE
    • Pull from Repository:
    • Pull 3.5 Branch:
    • Pull 3.6 Branch:
    • Pull 3.7 Branch:
    • Pull Master Branch:
      MDL-65605-master

      Description

      1. Given I am logged in as a teacher
      2. And I am viewing a lesson
      3. And I click "Import questions"
      4. When I click "Import" without uploading a file first
      5. Then I should be told to add a file

      Actual:

      Warning: count(): Parameter must be an array or an object that implements Countable in /Users/nicols/Sites/moodles/sm/moodle/mod/lesson/import_form.php on line 72
      

      And no meaningful error.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                8/Jul/19

                Time Tracking

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