I use Drupal 7.12 with the french translations + I use french content with accents.

When I try to add tags to an article, the autocomplete does not work.
When I try to save the article with the tags, I have the following errors:

Warning : htmlspecialchars(): Invalid multibyte sequence in argument dans check_plain() (ligne 1572 dans /var/www/test.toto.com/includes/bootstrap.inc).
PDOException : dans DrupalDefaultEntityController->load() (ligne 196 dans /var/www/test.toto.com/includes/entity.inc).
Le site Web a rencontré une erreur inattendue. Veuillez essayer de nouveau plus tard.

There is no way to add tags.

I have readed the following thread http://drupal.org/node/987472 and tried the following patch http://drupal.org/files/issues/multibyte_excert_fix.patch (adapted to the 7.12 version) with no success!

Please help me :)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

marcingy’s picture

Priority: Critical » Normal

This is not critical

xjm’s picture

Version: 7.12 » 8.x-dev
Component: search.module » taxonomy.module
Issue tags: +Needs backport to D7
damien_vancouver’s picture

@Hurukan,

This is not the same bug as #987472: search.module doesn't consistently support multibyte characters. It is the same error message though. That is why the patch from 987472 didn't fix your problem.

I generated 1000 test terms full of random French accent characters, and autocomplete still worked fine for me when adding new nodes and autocompleting.

So, we will need your actual taxonomy terms that are failing. Can you list all the terms here? Or, can you link to a MySQL Database Export of your taxonomy tables? (taxonomy_index, taxonomy_term_data, taxonomy_term_hierarchy and taxonomy_vocabulary)?

Once we have the actual terms that are failing, we should be able to reproduce it and find the problem.

xjm’s picture

Anonymous’s picture

Version: 8.x-dev » 7.12
Priority: Normal » Major
FileSize
3.08 KB

Hello Damien,

In fact I have only words with the characters "é"! (weird to have a bug with a such character)
I have attached the extract of my database (there is a prefix for table names)

Tell me if you can reproduce it! (In fact I hope, else I do not see from where it comes!)

xjm’s picture

Version: 7.12 » 7.x-dev
Category: bug » support
Priority: Major » Normal

Please don't change the version and priority. Thanks!

Moving to support request unless we can get some global steps to reproduce the issue. Maybe someone can test with the dump from #5 to check if it is instead an environment problem, since @damien_vancouver wasn't able to reproduce it.

xjm’s picture

Version: 7.x-dev » 8.x-dev

Er.

Heine’s picture

The issue is reported (but not confirmed) in 7.12. An 8.x-dev tag doesn't make sense.

xjm’s picture

Version: 8.x-dev » 7.12
damien_vancouver’s picture

@Hurukan,

thanks for the SQL extract. I loaded your taxonomy tables on my test database and I still wasn't able to reproduce the problem - see attached screenshot of it working for me. I tried autocompleting with every letter, A through Z, and then also as a regular user instead of the admin uid=1 user. Your data looks fine in the tables, so we've at least ruled out that the problem is corrupt data in MySQL.

So.... something to do with your other enabled modules must be causing the problem to occur.

Based on the difficulty we had locating one of these bugs in #987472, I think the easiest way to proceed would be for you to send me a complete database dump to test with. I'll send you an email via your contact form, so you can send that to me directly, rather than post the entire thing on here.

As soon as I can see the error here on my dev server, then I can use XDebug to figure out exactly where the bad data is occurring very quickly. Unfortunately, the error message we get occurs much later than the actual bug, which is why we have to do all this to find the real source of the problem.

If you can't share the database with me, I can explain the troubleshooting steps for you to try yourself, with either XDebug, PHP error logging, or watchdog logging.

Unfortunately, until we can reproduce it, we can't fix it. But we are making progress!

Anonymous’s picture

Thanks a lot for your help Damien,

I have sent you my whole database! I hope it helps :o)

Anonymous’s picture

Hello everyone,

I'm pretty new with the drupal debugging, where could I find a tutorial to debug this problem myself?!

:)

damien_vancouver’s picture

@Hurukan,

I took a look at your database, and autocomplete was broken for me adding articles. PHP errors were showing in the status log. Trying to save with a typed in term got a different error than you, a PDO SQL error, not the error described here.

But in testing, I found something weird on your field_tags Term Reference field which is on the Article content type. I made a new taxonomy, but I was unable to point the field_tags at it, because the Vocabulary dropdown was greyed out. When I tried adding a second Term Reference field to the Article content type, it also had a greyed out dropdown. Whe I deleted field_tags, everything started working.

So, try this, I think it will fix your problem: Just delete the old field_tags and make a new one to use, named the same thing. This will delete any terms you have saved in the database, if you have any you were able to save.

1) backup your database
2) in structure->content types->article, go to the Manage Fields tab. Delete the field_tags (Mots-clés)
3) Create a new field to replace it the same: ADd a new field, field_mots_cles , field type Term Reference, Widget Autcomplete Term Widget (tagging)
4) select Indicateurs as the vocabulary on the next screen, Number of values to unlimited the screen after that, and save.

Now, go and try and add an article, and try the autocomplete and saving it. It should work.

So.. that will fix your problem, but it doesn't explain it or the errors really.

My guess right now is somewhere along the way something got corrupted in your database. If the above fixes your problem, and nobody else reports this bug, then that's probably all it was.

Let me know if the above works for you.

Anonymous’s picture

Hello Damien, thanks a lot for your help!
I'm going to do what you say and I will tell you !

Those bugs are hard to spot :o)

Thanks again for all, maybe we can close the bug
and wait for another people to reopen it if someone else
has the problem ? :-)

xjm’s picture

Status: Active » Postponed (maintainer needs more info)
droplet’s picture

Version: 7.12 » 7.x-dev

Core issues are now filed against the dev versions where changes will be made. Document the specific release you are using in your issue comment. More information about choosing a version.