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

When editing a wiki page the default value for the tags is not being populated correctly

    Details

    • Testing Instructions:
      Hide

      1. Create a wiki activity
      2. Add a wiki page with some tags. Save. Tags are shown.
      3. Edit the wiki page and confirm that the tags that were initially entered are in the text box.

      Show
      1. Create a wiki activity 2. Add a wiki page with some tags. Save. Tags are shown. 3. Edit the wiki page and confirm that the tags that were initially entered are in the text box.
    • Workaround:
      Hide

      1. Re-enter the tags each time that the wiki page is edited.

      Show
      1. Re-enter the tags each time that the wiki page is edited.
    • Affected Branches:
      MOODLE_25_STABLE, MOODLE_26_STABLE, MOODLE_27_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE, MOODLE_26_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      When editing a wiki page the default value for the tags input box is empty even if there are tags. Saving the page will cause the tags to be deleted.

      Replication steps:

      1. Log in as teacher/admin.
      2. Create a Wiki activity.
      3. Add an initial page including multiple "Other" tags, separated by commas.
      4. Save the page.
      5. Click "Edit" in the tabs at the top.

      Expected result: The previously added tags should appear in the editing form.

      Actual result: No tags appear and the following error appears for each missing tag...

      Warning: Invalid argument supplied for foreach() in D:\xampp\htdocs\master_integration\lib\form\tags.php on line 216
      

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            mdikih Michael Wylde added a comment - - edited

            Please find a link to my commit which fixes this issue:
            https://github.com/mdikih/moodle/commit/99c9638c483234621ed3704f75598f7d88c47e44

            Any feedback is appreciated.

            Thanks,
            Michael

            Show
            mdikih Michael Wylde added a comment - - edited Please find a link to my commit which fixes this issue: https://github.com/mdikih/moodle/commit/99c9638c483234621ed3704f75598f7d88c47e44 Any feedback is appreciated. Thanks, Michael
            Hide
            salvetore Michael de Raadt added a comment -

            Thanks for reporting that and providing a fix, Michael and Adam.

            This should be backported to earlier supported branches.

            Show
            salvetore Michael de Raadt added a comment - Thanks for reporting that and providing a fix, Michael and Adam. This should be backported to earlier supported branches.
            Hide
            ankit_frenz Ankit Agarwal added a comment -

            Hi Guys,
            Thanks for working on this issue and providing a patch. The patch looks good for the most part. Just wondering if we need these two lines any more

                    if (!empty($CFG->usetags)) {
                        $params['tags'] = tag_get_tags_csv('wiki_pages', $this->page->id, TAG_RETURN_TEXT);
                    }
             

            Also consider back-porting this issue to stables.
            I would be watching this issue and will push for integration, once these concerns are addressed.
            Thanks

            Show
            ankit_frenz Ankit Agarwal added a comment - Hi Guys, Thanks for working on this issue and providing a patch. The patch looks good for the most part. Just wondering if we need these two lines any more if (!empty($CFG->usetags)) { $params['tags'] = tag_get_tags_csv('wiki_pages', $this->page->id, TAG_RETURN_TEXT); }   Also consider back-porting this issue to stables. I would be watching this issue and will push for integration, once these concerns are addressed. Thanks
            Hide
            mdikih Michael Wylde added a comment -

            Hi Ankit,

            I have removed the code like you suggested. I have applied this to master and back-ported to MOODLE_26_STABLE and MOODLE_25_STABLE. The commits are:
            25 - https://github.com/mdikih/moodle/commit/23353087ca50a9fb890201e17c05c83cebd7fc04
            26 - https://github.com/mdikih/moodle/commit/79f0a612c4d9db3c01d3ceec1d74d8e39d0b9275
            master - https://github.com/mdikih/moodle/commit/f2a4eac05aace2700cfc7198983a2b3273b6fe5a

            Thanks,
            Michael

            Show
            mdikih Michael Wylde added a comment - Hi Ankit, I have removed the code like you suggested. I have applied this to master and back-ported to MOODLE_26_STABLE and MOODLE_25_STABLE. The commits are: 25 - https://github.com/mdikih/moodle/commit/23353087ca50a9fb890201e17c05c83cebd7fc04 26 - https://github.com/mdikih/moodle/commit/79f0a612c4d9db3c01d3ceec1d74d8e39d0b9275 master - https://github.com/mdikih/moodle/commit/f2a4eac05aace2700cfc7198983a2b3273b6fe5a Thanks, Michael
            Hide
            ankit_frenz Ankit Agarwal added a comment -

            Thanks for the changes,
            Pushing forward.

            Show
            ankit_frenz Ankit Agarwal added a comment - Thanks for the changes, Pushing forward.
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Integrated (25, 26 & master), thanks!

            Side note, I've created MDL-43673 to cover this with acceptance tests (note that we should try to always provide them).

            Ciao

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Integrated (25, 26 & master), thanks! Side note, I've created MDL-43673 to cover this with acceptance tests (note that we should try to always provide them). Ciao
            Hide
            rwijaya Rossiani Wijaya added a comment -

            This is working as expected.

            Tested for 2.5, 2.6 and master

            Test passed.

            Show
            rwijaya Rossiani Wijaya added a comment - This is working as expected. Tested for 2.5, 2.6 and master Test passed.
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Well done is better than well said.

            Closing, big thanks!

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Well done is better than well said. Closing, big thanks!

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  10/Mar/14