Moodle

Make it possible to use numeric tags

Details

  • Type: Sub-task Sub-task
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 1.9
  • Fix Version/s: 1.9
  • Component/s: Tags
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE

Description

Numeric tags cause havoc because the tags code tries to guess what is a tag and an id. This means if a user enters tags: apple, pear, 2 then 2 will be converted to the tag with that id rather than the number.

Issue Links

Activity

Hide
Dan Poltawski added a comment -

And the problems with MDL-12316 as floats..

I dont think its desirable to guess the id/tag like this. Also we have a problem of performance as dbq has to be done for each of these tags like that.

Show
Dan Poltawski added a comment - And the problems with MDL-12316 as floats.. I dont think its desirable to guess the id/tag like this. Also we have a problem of performance as dbq has to be done for each of these tags like that.
Hide
Mathieu Petit-Clair added a comment -

My current plan is to remove all external use of numeric IDs (read: database primary key), except for a specific path, as per Martin's suggestion. This path will only accept the key. The rest will work like del.icio.us : urlencoded utf8 tags, which makes it possible to use numbers or any character. This does dramatically decrease the number of queries, as the ID is read only once and we won't have to figure out if we're dealing with a tag or with an id.

As about every function in /tag/lib.php accepts either, there is significant work (and tests...) to be done before I can commit this. Don't know if it will make it into 1.9... but as there won't be any database change, I guess it should..

Show
Mathieu Petit-Clair added a comment - My current plan is to remove all external use of numeric IDs (read: database primary key), except for a specific path, as per Martin's suggestion. This path will only accept the key. The rest will work like del.icio.us : urlencoded utf8 tags, which makes it possible to use numbers or any character. This does dramatically decrease the number of queries, as the ID is read only once and we won't have to figure out if we're dealing with a tag or with an id. As about every function in /tag/lib.php accepts either, there is significant work (and tests...) to be done before I can commit this. Don't know if it will make it into 1.9... but as there won't be any database change, I guess it should..
Hide
Mathieu Petit-Clair added a comment -

This is now possible.. as is using any unicode character (except the "," as it's the separator).

Show
Mathieu Petit-Clair added a comment - This is now possible.. as is using any unicode character (except the "," as it's the separator).
Hide
Martin Dougiamas added a comment -

Fixing the version information for this bug.

Show
Martin Dougiamas added a comment - Fixing the version information for this bug.
Hide
Rossiani Wijaya added a comment -

Tested and work.

Resolved

Closing

Show
Rossiani Wijaya added a comment - Tested and work. Resolved Closing

People

Dates

  • Created:
    Updated:
    Resolved: