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

Creating a group causes a PHP error.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.5, 2.3, 2.4
    • Fix Version/s: 2.2.6, 2.3.3
    • Component/s: Groups
    • Labels:
    • Testing Instructions:
      Hide

      1. Visit the url <yoursite>/admin/settings.php?section=systempaths
      2. Set GD Version to 'GD is not installed' and save
      2. Visit a course page
      2. Click on Users -> Groups
      3. Click to create a group
      4. When submitting the form ensure there is no error

      Show
      1. Visit the url <yoursite>/admin/settings.php?section=systempaths 2. Set GD Version to 'GD is not installed' and save 2. Visit a course page 2. Click on Users -> Groups 3. Click to create a group 4. When submitting the form ensure there is no error
    • Affected Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-35637_master

      Description

      When creating a group I receive the issue - "QuickForm Error: nonexistent html element Element 'imagefile' does not exist in HTML_QuickForm::getElement()"

      This error is because $CFG->gdversion is set to 0, so the 'imagefile' element is not being added to the form in group/group_form.php. However, after submission the function groups_update_group_icon is called in group/lib.php which attempts to save this image, regardless of the gdversion.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            rajeshtaneja Rajesh Taneja added a comment -

            Patch looks good Mark.

            It make sense to check for configuration before retrieving data, as we do while creating imagefile element in group_form.php

            Show
            rajeshtaneja Rajesh Taneja added a comment - Patch looks good Mark. It make sense to check for configuration before retrieving data, as we do while creating imagefile element in group_form.php
            Hide
            salvetore Michael de Raadt added a comment -

            Does this affect 2.2? If so, we should probably backport to that.

            Show
            salvetore Michael de Raadt added a comment - Does this affect 2.2? If so, we should probably backport to that.
            Hide
            markn Mark Nelson added a comment -

            Whoops, I tested in 2.2 and did not receive the error. I then looked at the code and it uses the same logic so wondered why it wasn't reproducing. Turns out I didn't have debugging turned on. :/ Adding 2.2 fix now and updating ticket.

            Show
            markn Mark Nelson added a comment - Whoops, I tested in 2.2 and did not receive the error. I then looked at the code and it uses the same logic so wondered why it wasn't reproducing. Turns out I didn't have debugging turned on. :/ Adding 2.2 fix now and updating ticket.
            Hide
            poltawski Dan Poltawski added a comment -

            The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

            TIA and ciao

            Show
            poltawski Dan Poltawski added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Integrated (22, 23 & master), thanks!

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Integrated (22, 23 & master), thanks!
            Hide
            dmonllao David Monllaó added a comment -

            It passes, tested in master and 22

            Show
            dmonllao David Monllaó added a comment - It passes, tested in master and 22
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Closing as fixed, many thanks for your awesome collaboration.

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Closing as fixed, many thanks for your awesome collaboration.

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  12/Nov/12