Uploaded image for project: 'Plugins'
  1. Plugins
  2. CONTRIB-7739

Behat tests fail because of a notice thrown in mod_form.php

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 3.7
    • Module: Advanced forum
    • None
    • 2018120300
    • MOODLE_37_STABLE

      Hello,

      I'm  using Moodle 3.7+ (2019052000.01) and mod_hsuforum version 2018120300.

      Several Behat tests are failing because of a PHP notice thrown by line 243 of mod_form.php. That section of code doesn't appear to be doing anything heinous - it's just trying to access an array within an array where the key doesn't exist.

      This is Behat's output:

       I need to be able to split threads to keep them on topic.
       
       
        Background:                                                                             # /var/www/html/mod/hsuforum/tests/behat/split_forum_discussion.feature:7
          Given the following "users" exist:                                                    # behat_hooks::i_look_for_exceptions()
            | username | firstname | lastname | email                |
            | teacher1 | Teacher   | 1        | teacher1@example.com |
            | student1 | Student   | 1        | student1@example.com |
          And the following "courses" exist:                                                    # behat_hooks::i_look_for_exceptions()
            | fullname    | shortname | category |
            | Science 101 | C1        | 0        |
          And the following "course enrolments" exist:                                          # behat_hooks::i_look_for_exceptions()
            | user     | course | role           |
            | teacher1 | C1     | editingteacher |
            | student1 | C1     | student        |
          And I log in as "teacher1"                                                            # behat_hooks::i_look_for_exceptions()
          And I am on "Science 101" course homepage with editing mode on                        # behat_hooks::i_look_for_exceptions()
          And I add a "Open Forum" to section "1" and I fill the form with:                     # behat_course::i_add_to_section_and_i_fill_the_form_with()
            | Forum name  | Study discussions                 |
            | Forum type  | Standard forum for general use    |
            | Description | Forum to discuss your coursework. |
            Exception: Moodle exception: Exception - Notice: Undefined index: assessed in [dirroot]/mod/hsuforum/mod_form.php on line 243 More information about this error
            
      --
            
            Exception - Notice: Undefined index: assessed in [dirroot]/mod/hsuforum/mod_form.php on line 243
            More information about this error
      

      Functionally, the plugin seems to work just fine. It's just that the array check is upsetting Behat.

      These are the Behat tests that are failing due to the array check:

       

      Component Feature Line Scenario
      mod_hsuforum accessibility_pin_button 27 “The pin button should exist”
      mod_hsuforum add_forum 8 “Add an Open Forum and a discussion attaching files”
      mod_hsuforum advanced_editor_pass_data_to_new_page 27 User can continue writting after clicking "Use advanced editor"
      mod_hsuforum advanced_search 36 “Perform an advanced search using any term”
      mod_hsuforum advanced_search 47 “Perform an advanced search avoiding words"
      mod_hsuforum advanced_search 59 “Perform an advanced search using whole words”
      mod_hsuforum advanced_search 73 “Perform an advanced search matching the subject”
      mod_hsuforum advanced_search 84 “Perform an advanced search matching the author”
      mod_hsuforum advanced_search 101 “Perform an advanced search with multiple words”
      mod_hsuforum edit_post_student 48 “Time limit expires”
      mod_hsuforum edit_post_teacher 35 “A teacher can delete another user's posts”
      mod_hsuforum edit_post_teacher 48 "A teacher can edit another user's posts”
      mod_hsuforum edit_post_teacher 64 "A student can't edit or delete another user's posts”
      mod_hsuforum edit_tags 30 “Forum post edition of custom tags works as expected”
      mod_hsuforum edit_tags 43 “Forum post edition of standard tags works as expected”
      mod_hsuforum forum_subscriptions 20 “A disallowed subscription forum cannot be subscribed to”
      mod_hsuforum forum_subscriptions 38 “A forced subscription forum cannot be subscribed to”
      mod_hsuforum forum_subscriptions 56 “An optional forum can be subscribed to”
      mod_hsuforum forum_subscriptions 75 “An Automatic forum can be unsubscribed from”
      mod_hsuforum forum_subscriptions_availability 27 “A forced forum lists all subscribers”
      mod_hsuforum forum_subscriptions_availability 40 “A forced forum does not allow to edit the subscribers”
      mod_hsuforum forum_subscriptions_availability 55 “A forced and hidden forum lists only teachers”
      mod_hsuforum forum_subscriptions_availability 70 An automatic forum lists all subscribers
      mod_hsuforum forum_subscriptions_default 22 Creating a new discussion in an optional forum follows user preferences
      mod_hsuforum forum_subscriptions_default 41 Replying to an existing discussion in an optional Open Forum follows user preferences
      mod_hsuforum forum_subscriptions_default 65 Creating a new discussion in an automatic forum follows forum subscription
      mod_hsuforum forum_subscriptions_default 84 Replying to an existing discussion in an automatic forum follows forum subscription
      mod_hsuforum forum_subscriptions_default 108 Replying to an existing discussion in an automatic forum which has been unsubscribed from follows user preferences
      mod_hsuforum forum_subscriptions_management 29 A teacher can change toggle subscription editing on and off
      mod_hsuforum inline_edit 27 Student can add discussion to forum with inline form
      mod_hsuforum inline_edit 38 Teacher can add discussion inline and then cancel and then finally add
      mod_hsuforum inline_edit 56 Student can add discussion inline and then cancel and then finally add
      mod_hsuforum posts_ordering_blog 33 Replying to a blog post or editing it does not affect its display order
      mod_hsuforum posts_ordering_general 27 Replying to a forum post or editing it puts the discussion to the front
      mod_hsuforum rate_posts 27 A teacher can edit another user's posts
      mod_hsuforum separate_group_single_group_discussions 58 Teacher with accessallgroups can post in all groups
      mod_hsuforum separate_group_single_group_discussions 73 Teacher in all groups but without accessallgroups can post in either group but not to All Participants
      mod_hsuforum split_forum_discussion 36 Split a forum discussion
      mod_hsuforum timed_discussions 7 Student should not see the tooltip or the discussion

            Unassigned Unassigned
            lexx_koto Alex Walker
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

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