Issue Details (XML | Word | Printable)

Key: MDL-12316
Type: Bug Bug
Status: Closed Closed
Resolution: Duplicate
Priority: Minor Minor
Assignee: Mathieu Petit-Clair
Reporter: John Beedell
Votes: 0
Watchers: 2
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

Error generated when entering a tag '4.2'

Created: 22/Nov/07 09:53 PM   Updated: 12/Feb/08 12:15 PM
Return to search
Component/s: Tags
Affects Version/s: 1.9
Fix Version/s: None

Issue Links:
Duplicate
 

Database: PostgreSQL
Participants: John Beedell, Mathieu Petit-Clair and Petr Skoda
Security Level: None
Affected Branches: MOODLE_19_STABLE


 Description  « Hide
This error was generated while trying to add a new 'interest' tag to a user's profile. The tag was deliberately entered as a float (to see what would happen).

ERROR: invalid input syntax for integer: " 4.2"

SELECT name FROM mdl_tag WHERE id = ' 4.2'

    * line 684 of lib/dmllib.php: call to debugging()
    * line 481 of lib/dmllib.php: call to get_recordset_sql()
    * line 421 of lib/dmllib.php: call to get_record_sql()
    * line 179 of tag/lib.php: call to get_record()
    * line 323 of tag/lib.php: call to tag_name()
    * line 457 of tag/lib.php: call to tag_name_from_string()
    * line 58 of user/editlib.php: call to update_item_tags()
    * line 111 of user/edit.php: call to useredit_update_interests()

This error is trivial in as much as the tag is not stored, and clicking on the continue button is available and works.

I expect that it is not possible to have tag names that are integers or floats, because the use of $tag_names_or_ids_cvs (a tag named with a number will be mistaken for an id passed here).

May I suggest a bit of javascript on the input fields for any tag entry that would inform the user that they has entered an illegal tag name, or a help button that explains the situation.

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Petr Skoda added a comment - 23/Nov/07 05:43 AM
hmm, instead of working around the problem it might be better to remove the general parameters and use ids and names instead - the code would be much easier and faster IMO...

Mathieu Petit-Clair added a comment - 12/Feb/08 12:15 PM
I'm closing this issue, as it duplicates the other one. We're working on it...