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

Moodle removes spaces in courses shortname in "bulk user actions"

    Details

    • Testing Instructions:
      Hide
      1. Create a course with a short name containing a space.
      2. Enrol users in that course
      3. Go to the bulk user actions page (Administration)
      4. Add a filter on the course role, and type the course short name in the field
      5. Validate the search
      6. Make sure the right users are returned
      7. Make sure the space wasn't stripped out of the course shortname
      Show
      Create a course with a short name containing a space. Enrol users in that course Go to the bulk user actions page (Administration) Add a filter on the course role, and type the course short name in the field Validate the search Make sure the right users are returned Make sure the space wasn't stripped out of the course shortname
    • Affected Branches:
      MOODLE_26_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE, MOODLE_26_STABLE
    • Pull Master Branch:
      MDL-43789_master

      Description

      Hi,

      I'm not sure if it's a bug or not, but when I use the "Bulk user action" to retrieve users of one course, Moodle removes all spaces of my filter's content. For example if I want users of the course with the shortname "UE 103", Moodle returns :

      Course role error: course "UE103" does not exist

      So I can't filter courses with spaces in shortname.

      I hope my explanations are straightforward.

      Best regards,
      Sylvain

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            danmarsden Dan Marsden added a comment -

            bouncing this up for peer review (I haven't had a chance to look closely at this yet)

            Show
            danmarsden Dan Marsden added a comment - bouncing this up for peer review (I haven't had a chance to look closely at this yet)
            Hide
            cibot CiBoT added a comment -

            Results for MDL-43789

            • Remote repository: git@github.com:rajeevs1992/moodle.git
            Show
            cibot CiBoT added a comment - Results for MDL-43789 Remote repository: git@github.com:rajeevs1992/moodle.git Remote branch MDL-43789 to be integrated into upstream master Executed job http://integration.moodle.org/job/Precheck%20remote%20branch/2842 Error: Unable to fetch information from MDL-43789 branch at git@github.com:rajeevs1992/moodle.git.
            Hide
            fred Frédéric Massart added a comment - - edited

            Hi guys,

            this patch makes perfect sense to me as the course shortname is a PARAM_TEXT itself, not a PARAM_ALPHANUMEXT.

            Rajeev, can I ask you to:

            1. Provide some testing instructions for this to make sure that it works as expected after your patch
            2. Provide the branches for 2.5, 2.6 and master
            3. Rewrite your commit message to match our guidelines: http://docs.moodle.org/dev/Commit_cheat_sheet#Provide_clear_commit_messages

            Once those points are addressed this can be pushed for integration.

            Many thanks!
            Fred

            Show
            fred Frédéric Massart added a comment - - edited Hi guys, this patch makes perfect sense to me as the course shortname is a PARAM_TEXT itself, not a PARAM_ALPHANUMEXT . Rajeev, can I ask you to: Provide some testing instructions for this to make sure that it works as expected after your patch Provide the branches for 2.5, 2.6 and master Rewrite your commit message to match our guidelines: http://docs.moodle.org/dev/Commit_cheat_sheet#Provide_clear_commit_messages Once those points are addressed this can be pushed for integration. Many thanks! Fred
            Hide
            rajeevs1992 Rajeev S added a comment - - edited

            Edited commit message.

            Testing Instructions:
            (difficulty: easy, requires Site Administration Privilages)
            1.Log in as Administrator
            2.Edit/Create a course,such that course short name contains a space
            3.Goto Site Administration>Users>Accounts>Bulk User Action
            4.In the New Filter section,Click Show More to expand the filters
            5.Add a course role filter, using a course short name with a non aplhanumeric character, say a space or a #
            6.Add filter.

            Branch for 2.5 : https://github.com/rajeevs1992/moodle/tree/MDL-43789_25
            Branch for 2.6 : https://github.com/rajeevs1992/moodle/tree/MDL-43789_26
            Branch for 2.7 : https://github.com/rajeevs1992/moodle/tree/MDL-43789_master

            Further, I have removed the previous branch.Sorry for the trouble.
            Also, Why is the Issue link author not added as a watcher?I feel it as a bug, as I was not notified about the activity in this issue.
            Finally, hyphen and underscore are counted as alphanumeric.(Is this a bug?)

            Show
            rajeevs1992 Rajeev S added a comment - - edited Edited commit message. Testing Instructions: (difficulty: easy, requires Site Administration Privilages) 1.Log in as Administrator 2.Edit/Create a course,such that course short name contains a space 3.Goto Site Administration>Users>Accounts>Bulk User Action 4.In the New Filter section,Click Show More to expand the filters 5.Add a course role filter, using a course short name with a non aplhanumeric character, say a space or a # 6.Add filter. Branch for 2.5 : https://github.com/rajeevs1992/moodle/tree/MDL-43789_25 Branch for 2.6 : https://github.com/rajeevs1992/moodle/tree/MDL-43789_26 Branch for 2.7 : https://github.com/rajeevs1992/moodle/tree/MDL-43789_master Further, I have removed the previous branch.Sorry for the trouble. Also, Why is the Issue link author not added as a watcher?I feel it as a bug, as I was not notified about the activity in this issue. Finally, hyphen and underscore are counted as alphanumeric.(Is this a bug?)
            Hide
            fred Frédéric Massart added a comment -

            Thanks Rajeev,

            you were not notified because you are not the assignee on this issue. I will check if we can give you that level of permissions.

            Meanwhile I am pushing your patch for integration.

            Thanks!
            Fred

            PS: I added the testing instructions, could you revise them. Next time that would be nice if you could provide them.

            Show
            fred Frédéric Massart added a comment - Thanks Rajeev, you were not notified because you are not the assignee on this issue. I will check if we can give you that level of permissions. Meanwhile I am pushing your patch for integration. Thanks! Fred PS: I added the testing instructions, could you revise them. Next time that would be nice if you could provide them.
            Hide
            salvetore Michael de Raadt added a comment -

            Thanks for working on this, Rajeev.

            I've added you to the jira-developers group and assigned this issue to you.

            Show
            salvetore Michael de Raadt added a comment - Thanks for working on this, Rajeev. I've added you to the jira-developers group and assigned this issue to you.
            Hide
            poltawski Dan Poltawski added a comment -

            Thanks Rajeev, i've integrated your changes to master, 26 and 25.

            Note that it seems your 26 branch was not rebased quite correctly so I cherry-picked there. cheers!

            Show
            poltawski Dan Poltawski added a comment - Thanks Rajeev, i've integrated your changes to master, 26 and 25. Note that it seems your 26 branch was not rebased quite correctly so I cherry-picked there. cheers!
            Hide
            lameze Simey Lameze added a comment -

            Thanks for work in this issue. Test passed.

            Show
            lameze Simey Lameze added a comment - Thanks for work in this issue. Test passed.
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Your code is now part of Moodle upstream, many thanks!

            It's a constant, continuous,
            spectacular world we live in,
            and every day you see things that
            just knock you out, if you pay attention.

            Robert Irwin

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Your code is now part of Moodle upstream, many thanks! It's a constant, continuous, spectacular world we live in, and every day you see things that just knock you out, if you pay attention. Robert Irwin

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  12/May/14