moodleou / moodle-mod_forumng

ForumNG forum module for Moodle
19 stars 20 forks source link

Bit of an Odd One #52

Closed StephHay closed 8 years ago

StephHay commented 8 years ago

We have a case where if someone types the word 'cafe' into a ForumNG post they receive an error writing to database and are taken out of the discussion back to our Moodle home page. We are using Moodle 2.8.6. This seems like a very odd error to be cropping up, has this been reported before? If you need more information please let me know.

Cheers,

Steph

jason-platts commented 8 years ago

This sounds like an issue with unicode characters (I'm assuming cafe with an accent (Café) is the issue). You can probably confirm this by pasting other 'special' characters or inserting with the TinyMCE/Atto button that does this.

What database type are you using?

StephHay commented 8 years ago

Apologies Jason I thought I had replied to this. Oddly enough it is happening to the word café when typed in without the accent or when copied in as plain text. We are using MariaDB (5.5.41).

Cheers,

Steph

From: Jason Platts [mailto:notifications@github.com] Sent: 06 October 2015 11:12 To: moodleou/moodle-mod_forumng moodle-mod_forumng@noreply.github.com Cc: HAY Stephannie stephannie.hay@ed.ac.uk Subject: Re: [moodle-mod_forumng] Bit of an Odd One (#52)

This sounds like an issue with unicode characters (I'm assuming cafe with an accent (Café) is the issue). You can probably confirm this by pasting other 'special' characters or inserting with the TinyMCE/Atto button that does this.

What database type are you using?

— Reply to this email directly or view it on GitHubhttps://github.com/moodleou/moodle-mod_forumng/issues/52#issuecomment-145811331.

The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.

jason-platts commented 8 years ago

This is very strange. Can you write 'cafe' OK into the text of other tools such as core forum, wiki, glossary, page or label? What about words that contain cafe like cafeteria? What is the database error you get?

sammarshallou commented 8 years ago

Also, have you installed the local_ousearch search plugin in order to provide search facilities within ForumNG?

If you have, it might possibly be linking the new word 'cafe' to an existing word 'café', and then falling over because the database is set up wrong e.g. not set to use unicode UTF-8 for the relevant text fields. In fact I think i've had this reported before... (Basically because ugh MySQL.)

sammarshallou commented 8 years ago

Just remembered something more specific - I think it was like, somebody has already typed café so that is in the search index. Now, somebody types it without the accent. local_ousearch thinks cafe is a different word to café (which is probably correct) and it tries to add it to the word list. But MySQL (if configured in whatever manner) then thinks the unique index on local_ousearch_words fails because cafe and café are somehow identical strings (because it's crazy), Something like that! I don't remember how it was resolved though...

StephHay commented 8 years ago

Hey,

Apologies for the delay in responding on this one, oddly enough I am now receiving a similar problem with the name Riette in the OU wiki. Writing café into the other tools isn’t a problem and cafeteria doesn’t cause an issue either in the core tools or ForumNG.

The error links to this page on the Moodle Docs site - https://docs.moodle.org/28/en/error/moodle/dmlwriteexception

I also received emails from Sam Marshall suggesting it might have to do with the local_ousearch search plugin that we have installed – is there a particular aspect of the database that I should be looking at in this respect? It looks like this might affect all our OU plugins and since they are used a lot I would like to try and resolve it as quickly as we can. Let me know if I can provide any further information or if there is something we can look at within the database set up.

Cheers,

Steph Stephannie Hay Service Manager Digital Learning Applications & Media

Looking for a technology to help with your teaching? Try using TREE www.tree.is.ed.ac.ukhttp://www.tree.is.ed.ac.uk/

From: Jason Platts [mailto:notifications@github.com] Sent: 19 October 2015 16:52 To: moodleou/moodle-mod_forumng moodle-mod_forumng@noreply.github.com Cc: HAY Stephannie stephannie.hay@ed.ac.uk Subject: Re: [moodle-mod_forumng] Bit of an Odd One (#52)

This is very strange. Can you write 'cafe' OK into the text of other tools such as core forum, wiki, glossary, page or label? What about words that contain cafe like cafeteria? What is the database error you get?

— Reply to this email directly or view it on GitHubhttps://github.com/moodleou/moodle-mod_forumng/issues/52#issuecomment-149255776.

The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.

sammarshallou commented 8 years ago

Steph: I think it's something to do with the MySQL collation setting (if it has one) or encoding setting, specifically with regard to the 'word' field of the mdl_local_ousearch_words table. Potentially, this table's unique index causes it to think that you can't insert 'cafe' into the table when you already have a row containing 'café' - even though those are different words, for some reason MySQL is treating them as the same.

We don't use MySQL so this is just my memory of what happened - I don't remember how you have to fix it, but I think something like this happened to somebody else once. If you can get it to do comparisons against the exact binary content of the field or something like that, that would probably help.

aspark21 commented 8 years ago

That would be this issue you have in mind Sam - https://github.com/moodleou/moodle-local_ousearch/issues/5

As far as we are concerned that solved it and haven't had any issues with it since though. Steph what version of the ousearch plugin are you on? It was resolved in version 2015010500, if you have an older version then update.

sammarshallou commented 8 years ago

Thanks for linking that issue Alistair! Yes that's the one I meant and it does look like it should have been fixed in that version. (Wow my memory is terrible - I had totally forgotten that we applied a code fix.)

StephHay commented 8 years ago

Excellent thanks Sam and Alistair, I will get the plugin updated. All the help was much appreciated.

Cheers,

Steph

From: sam marshall [mailto:notifications@github.com] Sent: 05 November 2015 10:29 To: moodleou/moodle-mod_forumng moodle-mod_forumng@noreply.github.com Cc: HAY Stephannie stephannie.hay@ed.ac.uk Subject: Re: [moodle-mod_forumng] Bit of an Odd One (#52)

Thanks for linking that issue Alistair! Yes that's the one I meant and it does look like it should have been fixed in that version. (Wow my memory is terrible - I had totally forgotten that we applied a code fix.)

— Reply to this email directly or view it on GitHubhttps://github.com/moodleou/moodle-mod_forumng/issues/52#issuecomment-154021739.

The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.