I get an error "PDOException dblog_watchdog() line 155" when i try to add a node which it's title consists of a spesific combination of Greek letters. I Currently have Pathauto to deal with the aliases. The default language is set to Greek.
Tracking down line 155 in dblog_watchdog i decided to delete the following line:
'link' => substr($log_entry['link'], 0, 255) and the PDOException dissapeared
Also using 'link' => mb_substr($log_entry['link'], 0, 255) instead of substr($log_entry['link'], 0, 255)
seems to also do the trick
Also switching the default language from Greek to English also seemed to make the error go away
One of the spesific urls that throw the PDOexception is: φορείς-δικτύου/σοροπτιμιστική-ένωση-ελλάδος
I don't get much more information besides it being a PDOException at line 155
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | dblog_line155error.patch | 1.2 KB | dzhu |
| #4 | dblog-non_latin_characters_in_url-1888592-4.patch | 634 bytes | orb |
| #2 | dblog-non_latin_characters_in_url-1888592-2.patch | 647 bytes | orb |
Comments
Comment #1
detectivepixel commentedChanging the default translation string for the word "view" that Localization update downloaded seems to work.
Steps to reproduce the exception on an (almost) bare bones Drupal 7.18 installation
- Enable Locale
- Add Language Greek
- Download and enable Localization update and update the translations (haven't tried to import manually)
- Add a node with URL alias "φορείς-δικτύου/σοροπτιμιστική-ένωση-ελλάδος"
-Translate the word view as "προβολή" (this might not be necessary since localization update translates the word like that)
Comment #2
orb commentedChange substr($log_entry['link'], 0, 255),
to
drupal_substr($log_entry['link'], 0, 255),
Comment #4
orb commentedFix
Comment #5
orb commentedComment #7
podarok#4: dblog-non_latin_characters_in_url-1888592-4.patch queued for re-testing.
Comment #9
dzhu commentedThe same issue for saving nodes that have long synonyms in Russian.
My proposal: increase link field in watchdog table from 255 to 1024. Here is part of the patch:
Comment #10
orb commentedThe problem is not here.
Previous module sends the string in two encodings - 8 and 16 bit.
See module pathauto or eq
Comment #11
IRuslan commentedI fall into similar problem.
For me error looks like:
PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect string value: '\xD8' for column 'link'.During insertion into watchdog table.
It's a some float problem (may be related to certain chars in arabic for me), and i think it's related to pathauto.
Value of link in my case it's a l('view', 'node/' . $node->nid). It comes from node_form_submit() during node creation.
I suppose that it's not substr() problem because link comes urlencoded and doesn't contain non-utf chars normally.
But for some reason in the middle of string there is a broken character, which could not be encoded, and then brake insertion.
Unfortunately, for now i have no solution.
Comment #12
damien tournoud commented#2 looks like a valid bug fix. It need to be applied to Drupal 8 first, could we get it forward ported?
Comment #12.0
damien tournoud commentedAdded some more information that could help with the issue
Comment #13
periksson commentedI get the same exception, but for me it appears to be the REQUEST_URI and not the LINK:
Added:
And it appears that the Request URI is coded as latin1 but read as unicode:
PHPs own $SERVER['REQUEST_URI'] seems to handle this much better:
Now this is something you actually can send to the database. :-)
Best
Eric
Comment #14
alexpottThis is a dupe of #1328014: PDOException when saving a node on non-English languages