Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.3
    • Fix Version/s: 2.1
    • Component/s: Activity completion
    • Labels:
    • Testing Instructions:
      Hide

      Difficulty: EASY (but requires some familiarity with html)

      0. Ensure that the site-level availability and completion options are enabled, and that a test course has completion enabled.
      1. From the 'Add a resource' dropdown, choose 'Label' so that you get the module editing form.
      2. By viewing source or using Firebug or similar extension, check that the two fieldsets 'Activity completion' and 'Restrict access' both now have ID values (they did not before).
      3. Type in some text for the label and save the form (there are supposed to be no changes to this, but just to check it's not broken).

      Show
      Difficulty: EASY (but requires some familiarity with html) 0. Ensure that the site-level availability and completion options are enabled, and that a test course has completion enabled. 1. From the 'Add a resource' dropdown, choose 'Label' so that you get the module editing form. 2. By viewing source or using Firebug or similar extension, check that the two fieldsets 'Activity completion' and 'Restrict access' both now have ID values (they did not before). 3. Type in some text for the label and save the form (there are supposed to be no changes to this, but just to check it's not broken).
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE
    • Pull Master Branch:
      MDL-27627-master
    • Rank:
      17458

      Description

      There are few mform elements that are added without any id name, which means, if one wants to select it (to hide or remove or whatever) it is difficult.

      The example codes are: in "course->moodleform_mod.php"
      1) line 436, $mform->addElement('header', '', get_string('availabilityconditions', 'condition'));
      2) line 530, $mform->addElement('header', '', get_string('activitycompletion', 'completion'));

      They need some name names to be assigned. once that is done, possibly anyone using those elements referring with empty names also might need changing.

        Activity

        Hide
        Michael de Raadt added a comment -

        So, if I'm interpreting this correctly, there are form elements that are being instantiated without IDs and therefore cannot be easily modified.

        Show
        Michael de Raadt added a comment - So, if I'm interpreting this correctly, there are form elements that are being instantiated without IDs and therefore cannot be easily modified.
        Hide
        Sam Marshall added a comment -

        Michael: Yes you are correct. If when writing code for a custom module, you would like to hide these elements from the module's form, it isn't possible at present because they do not have IDs. (Note: this is my fault

        I don't think fix is required in 2.0 particularly as it is probably a rare requirement for plugin developers, so I have only done it for master branch.

        Show
        Sam Marshall added a comment - Michael: Yes you are correct. If when writing code for a custom module, you would like to hide these elements from the module's form, it isn't possible at present because they do not have IDs. (Note: this is my fault I don't think fix is required in 2.0 particularly as it is probably a rare requirement for plugin developers, so I have only done it for master branch.
        Hide
        Sam Hemelryk added a comment -

        Thanks Sam this has been integration now

        Show
        Sam Hemelryk added a comment - Thanks Sam this has been integration now
        Hide
        Michael de Raadt added a comment -

        Testing results:

        The id for the "Restrict access" fieldset is set as "availabilityconditionsheader".
        The id for the "Activity completion" fieldset is set as "activitycompletionheader".

        Desired result achieved.

        Show
        Michael de Raadt added a comment - Testing results: The id for the "Restrict access" fieldset is set as "availabilityconditionsheader". The id for the "Activity completion" fieldset is set as "activitycompletionheader". Desired result achieved.
        Hide
        Eloy Lafuente (stronk7) added a comment -

        This is now part of upstream. Many thanks!

        Show
        Eloy Lafuente (stronk7) added a comment - This is now part of upstream. Many thanks!

          People

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

            Dates

            • Created:
              Updated:
              Resolved: