Duplicate tags in page creation gives error message
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| Mahara |
Low
|
Robert Lyon | ||
| 1.8 |
Low
|
Robert Lyon |
Bug Description
Has anyone noticed, when creating a page, that if you put a tag in twice, the page will be created but you get an error message? I've tested this on two accounts and it's consistent - I've been able to test it on our own site and on a free host.
The error message is: Site unavailable
A nonrecoverable error occured. This probably means you have encountered a bug in the system
For example, if you create a page, and put the tags university and University, the error is given.
Our version of Mahara is 1.7.0 but I'm not sure what the free host has (it has all the same functions as our own).
Firefox 23 and IE 9
Marion
Kristina Hoeppner (kris-hoeppner) wrote : | #1 |
Aaron Wells (u-aaronw) wrote : | #2 |
I was able to replicate this in MySQL.
It looks like it's because in MySQL the primary key on the view_tags table is case-insensitive, while in Postgresql it's case-sensitive.
tags: | added: mysql tags |
Changed in mahara: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
importance: | Medium → Low |
Robert Lyon (robertl-9) wrote : | #3 |
have added a patch for this:
https:/
Changed in mahara: | |
status: | Confirmed → In Progress |
assignee: | nobody → Robert Lyon (robertl-9) |
Changed in mahara: | |
milestone: | none → 1.8.1 |
Robert Lyon (robertl-9) wrote : | #4 |
Here is some information about mysql collation types and how they handle case sensitivity
http://
Changed in mahara: | |
status: | In Progress → Confirmed |
assignee: | Robert Lyon (robertl-9) → nobody |
Aaron Wells (u-aaronw) wrote : | #5 |
Some updates on this. Robert's supplied patch changes the collation type of some columns to binary. We'd need to do this in on installation as well (which wouldn't be too hard, just toss it in the post-install function).
We were discussing at a meeting recently whether it might be a good idea to just set the default collation for the whole database, to binary. Apparently there is at least one of our clients who has done this with a production Mahara instance, and it has worked out fine for them as far as we know.
If we did decide to do that, we could make it be part of the installation sanity check. That way, people setting up new databases would be prompted to set the collation correctly, while people in existing Mahara databases would not find their site suddenly complaining about it.
Changed in mahara: | |
milestone: | 1.8.1 → 1.9.0 |
Robert Lyon (robertl-9) wrote : | #6 |
I've altered the patch - have taken another approach.
Now the patch checks the table collation for mysql and if is case insensitive then reduces the tag array to unique lowercase options.
A useful sql query for testing mysql tables (going from case insensitive to case sensitive)
alter table <tablename> convert to character set utf8 collate utf8_bin;
Steven (stevens-q) wrote : | #7 |
=== Bug #1231920 Duplicate tags in page creation gives error message ===
Test Plan
------------
1. Create a new page.
2. Enter a page title.
3. Enter in the tag field: University, university
4. Click the "Save" button.
5. Confirm that there are no error messages using OS Linux & windows7 IE9
Test Result
-------------
5. Confirmed that there are no error messages. ✔
**Note:** I am unable to test this bug because I do not have a MySQL database - works on Postgres
Catalyst QA Approved ✔
tags: | added: test2 |
tags: | removed: test2 |
Reviewed: https:/
Committed: http://
Submitter: Aaron Wells (<email address hidden>)
Branch: master
commit ae9591c2f086cd5
Author: Robert Lyon <email address hidden>
Date: Fri Jan 3 13:30:45 2014 +1300
Checking case sensitivity for mysql tag tables (bug #1231920)
Compressing array of tags to unique case insensitive values if needed
Eg
array('
will become
array('
for mysql sites that have case insensitive tables
Change-Id: Idf0b8a4440ef0f
Signed-off-by: Robert Lyon <email address hidden>
Kristina Hoeppner (kris-hoeppner) wrote : | #9 |
Aaron, are we going to change it also for 1.8 or only 1.9 seeing that it's marked as "low"?
Patch for "1.8_STABLE" branch: https:/
Robert Lyon (robertl-9) wrote : | #11 |
Seen as the patch merges without problems we might as well change it for 1.8 as well
Reviewed: https:/
Committed: http://
Submitter: Robert Lyon (<email address hidden>)
Branch: 1.8_STABLE
commit 681da9555423223
Author: Robert Lyon <email address hidden>
Date: Fri Jan 3 13:30:45 2014 +1300
Checking case sensitivity for mysql tag tables (bug #1231920)
Compressing array of tags to unique case insensitive values if needed
Eg
array('
will become
array('
for mysql sites that have case insensitive tables
Change-Id: Idf0b8a4440ef0f
Signed-off-by: Robert Lyon <email address hidden>
Changed in mahara: | |
status: | Fix Committed → Fix Released |
no longer affects: | mahara/1.9 |
Hello Marion,
I tested on http:// demo.mahara. org and could not replicate the problem. The site is on Mahara 1.7.2.
Steps I took:
1. Create a new page.
2. Enter a page title.
3. Enter in the tag field: University, university
4. Click the "Save" button.
5. No error message.
Can you please also check on the demo site with the steps you took? Please let us know if they differ from mine.
Since the error message on the screen is not very telling, can you please check your server error log for any more information and paste that here (obscuring / deleting all revealing info about your server first).
Cheers
Kristina