Moodle
  1. Moodle
  2. MDL-43005

tag param in blog index page should be strictly checked

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.6
    • Fix Version/s: 2.4.8, 2.5.4, 2.6.1
    • Component/s: Blog
    • Labels:
    • Testing Instructions:
      Hide
      1. Enable tags and blogs at site level.
      2. Create two tags "test" and "test1"
      3. Create a blog with tag "test" and another with tag "test1"
      4. Goto url blog/index.php?tag=test and make sure no error is generated and you are shown only one blog
        Regression testing
      5. Create/edit/delete/flag/add to my interest/delete from my interest/ a tag (you can do most of these from My home ► Tags ► tag name)
      6. Add a tags block and click on a tag name and make sure no error is noticed.
      Show
      Enable tags and blogs at site level. Create two tags "test" and "test1" Create a blog with tag "test" and another with tag "test1" Goto url blog/index.php?tag=test and make sure no error is generated and you are shown only one blog Regression testing Create/edit/delete/flag/add to my interest/delete from my interest/ a tag (you can do most of these from My home ► Tags ► tag name) Add a tags block and click on a tag name and make sure no error is noticed.
    • Affected Branches:
      MOODLE_26_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE, MOODLE_25_STABLE, MOODLE_26_STABLE
    • Pull Master Branch:
      MDL-43005-master
    • Story Points (Obsolete):
      4
    • Sprint:
      BACKEND Sprint 7

      Description

      we have

      $DB->get_record_sql("SELECT * FROM {tag} WHERE ". $DB->sql_like('name', '?', false), array("%$tag%")

      Which returns error like

      Error: mdb->get_record() found more than one record!
       
          line 1427 of /lib/dml/moodle_database.php: call to debugging()
          line 43 of /blog/index.php: call to moodle_database->get_record_sql()

      when we have two tags similar to each other. For example: - tag and tagtest

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            Ankit Agarwal added a comment -

            This doesn't block as such MDL-40040, however would be nice to have this in for proper testing of MDL-40040

            Show
            Ankit Agarwal added a comment - This doesn't block as such MDL-40040 , however would be nice to have this in for proper testing of MDL-40040
            Hide
            Ankit Agarwal added a comment -

            While working on this, I noticed the tag filter was not working as well. so added a fix for the same.

            Show
            Ankit Agarwal added a comment - While working on this, I noticed the tag filter was not working as well. so added a fix for the same.
            Hide
            Adrian Greeve added a comment -

            [Y] Syntax
            [Y] Whitespace
            [Y] Output
            [-] Language
            [-] Databases
            [Y] Testing (instructions and automated tests)
            [-] Security
            [-] Documentation
            [Y] Git
            [-] Third party code
            [Y] Sanity check

            Thanks Ankit. This looks good to me.

            Show
            Adrian Greeve added a comment - [Y] Syntax [Y] Whitespace [Y] Output [-] Language [-] Databases [Y] Testing (instructions and automated tests) [-] Security [-] Documentation [Y] Git [-] Third party code [Y] Sanity check Thanks Ankit. This looks good to me.
            Hide
            Ankit Agarwal added a comment -

            Thanks Adrian, pushing forward.

            Show
            Ankit Agarwal added a comment - Thanks Adrian, pushing forward.
            Hide
            Dan Poltawski added a comment -

            Hi Ankit,

            Can you confirm that you've audited all the places where we might be linking to this and verified that its never being used like a search field (with the like)?

            Show
            Dan Poltawski added a comment - Hi Ankit, Can you confirm that you've audited all the places where we might be linking to this and verified that its never being used like a search field (with the like)?
            Hide
            Ankit Agarwal added a comment -

            Hi Dan,
            I looked at current usage in code and I couldn't find any place where it is used as a search param. It is mostly used in tags block and some actions from tags management page. At those places it needs to be an exact match. I added a few more steps to testing instruction, to test these cases anyway for regressions.

            Thanks

            Show
            Ankit Agarwal added a comment - Hi Dan, I looked at current usage in code and I couldn't find any place where it is used as a search param. It is mostly used in tags block and some actions from tags management page. At those places it needs to be an exact match. I added a few more steps to testing instruction, to test these cases anyway for regressions. Thanks
            Hide
            Sam Hemelryk added a comment -

            Thanks Ankit - this has been integrated now.

            Show
            Sam Hemelryk added a comment - Thanks Ankit - this has been integrated now.
            Hide
            Rossiani Wijaya added a comment -

            Hi Ankit,

            This is working as expected.

            Tested for 2.4, 2.5, 2.6 and master.

            While testing this, I noticed couple of UI bug needed on the editing page. I will create new issue to fix it (MDL-43077).

            Other than that, this is working great.

            Test passed.

            Show
            Rossiani Wijaya added a comment - Hi Ankit, This is working as expected. Tested for 2.4, 2.5, 2.6 and master. While testing this, I noticed couple of UI bug needed on the editing page. I will create new issue to fix it ( MDL-43077 ). Other than that, this is working great. Test passed.
            Hide
            Dan Poltawski added a comment -

            Congratulations, this change has now made its way upstream. Thanks for your contribution!

            “ Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. ” - Rick Osborne

            Show
            Dan Poltawski added a comment - Congratulations, this change has now made its way upstream. Thanks for your contribution! “ Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. ” - Rick Osborne

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Agile