Moodle
  1. Moodle
  2. MDL-15731

Default grouping applies to label, resource, glossary but is disabled

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 1.9.2
    • Fix Version/s: 1.9.3
    • Component/s: Groups
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE
    • Rank:
      31284

      Description

      To reproduce:

      Setup:

      1) Enable groupings (experimental option)
      2) Create a new course
      3) Create a new grouping
      4) Set the default grouping

      Bug:

      1) Create a new Label, Resource, or Glossary
      2) Click 'Show advanced'

      • Observe that the grouping is both set (to the default you mentioned), and also disabled
        3) Save the label/resource/glossary
      • Observe that the grouping is shown next to the item, even though it won't do anything

      These modules do not support groups, so grouping is only useful when the 'group members only' feature is enabled. Consequently, the UI correctly disables the grouping option unless you tick that checkbox. However the grouping option remains on, which is confusing.

      The solution is to make it so that these three modules have a default grouping of none, even when the course has a default grouping. Users who turn on 'group members only' can then select a grouping if required, but it will not display otherwise.

      Obviously a minor problem but this was confusing our staff...

        Activity

        Hide
        Sam Marshall added a comment -

        I have applied a basic fix to this problem and tested in the following situations:

        1) add label - default grouping is now 'none'
        2) add label, enable 'group members only', select grouping - works to set grouping
        3) add forum (module which does support groupings) - works with default grouping (unchanged)

        The fix is a hack for specific module names which should cover this trivial problem. A better fix might be available using the _supports API I want for Moodle 2.0.

        File affected was course/modedit.php. I checked fix in to MOODLE_19 and tagged it MOODLE_19_MERGED (which it actually isn't quite yet, I'm getting Tim to do that because that file is modified in my HEAD checkout).

        Show
        Sam Marshall added a comment - I have applied a basic fix to this problem and tested in the following situations: 1) add label - default grouping is now 'none' 2) add label, enable 'group members only', select grouping - works to set grouping 3) add forum (module which does support groupings) - works with default grouping (unchanged) The fix is a hack for specific module names which should cover this trivial problem. A better fix might be available using the _supports API I want for Moodle 2.0. File affected was course/modedit.php. I checked fix in to MOODLE_19 and tagged it MOODLE_19_MERGED (which it actually isn't quite yet, I'm getting Tim to do that because that file is modified in my HEAD checkout).
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Instead of harcoding this in modedit... couldn't we use the new supports_feature(MODULE_GROUPINGS) function? Just one idea. Ciao

        Show
        Eloy Lafuente (stronk7) added a comment - Instead of harcoding this in modedit... couldn't we use the new supports_feature(MODULE_GROUPINGS) function? Just one idea. Ciao
        Hide
        Petr Škoda added a comment -

        there is a new code module features, I guess this should be migrated there instead of the hardcoding

        Show
        Petr Škoda added a comment - there is a new code module features, I guess this should be migrated there instead of the hardcoding
        Hide
        Jérôme Mouneyrac added a comment - - edited

        Tested on 1.9, I confirm that it has been fixed and it works as Sam described it. However I reopen as Petr put a comment. Sam, if you are not going to add/commit anything in this issue, you can directly close it as it works.
        Thanks all for your participation.

        Show
        Jérôme Mouneyrac added a comment - - edited Tested on 1.9, I confirm that it has been fixed and it works as Sam described it. However I reopen as Petr put a comment. Sam, if you are not going to add/commit anything in this issue, you can directly close it as it works. Thanks all for your participation.
        Hide
        Sam Marshall added a comment -

        Thanks for testing. I am closing this issue - I do agree with Petr's comment but the new feature system applies only to 2.0, while I put this fix into 1.9 since it's a 1.9 bug.

        For fixing this to use the new system mentioned, I don't think there's any point fixing just this specific hack, I think we should do it a bit more generally. (Doesn't necessarily have to be in 2.0 either, even hough it would be nice.)

        Show
        Sam Marshall added a comment - Thanks for testing. I am closing this issue - I do agree with Petr's comment but the new feature system applies only to 2.0, while I put this fix into 1.9 since it's a 1.9 bug. For fixing this to use the new system mentioned, I don't think there's any point fixing just this specific hack, I think we should do it a bit more generally. (Doesn't necessarily have to be in 2.0 either, even hough it would be nice.)

          People

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

            Dates

            • Created:
              Updated:
              Resolved: