Hi,
It used to be just fine until last update, since than i get this all over the pages (debug mode) and boost header is missing, so i guess it is not working anymore.
any ideas what could be the problem?
---------------------------------------------------------------------------
PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect string value: '\x93-25-&...' for column 'message' at row 1.
#0 /home/sabresim/public_html/includes/database/database.inc(2137): PDOStatement->execute(Array)
#1 /home/sabresim/public_html/includes/database/database.inc(664): DatabaseStatementBase->execute(Array, Array)
#2 /home/sabresim/public_html/includes/database/mysql/query.inc(36): DatabaseConnection->query('INSERT INTO {wa...', Array, Array)
#3 /home/sabresim/public_html/modules/dblog/dblog.module(157): InsertQuery_mysql->execute()
#4 [internal function]: dblog_watchdog(Array)
#5 /home/sabresim/public_html/includes/module.inc(795): call_user_func_array('dblog_watchdog', Array)
#6 /home/sabresim/public_html/includes/bootstrap.inc(1675): module_invoke('dblog', 'watchdog', Array)
#7 /home/sabresim/public_html/sites/all/modules/boost/boost.module(1249): watchdog('boost', 'Array
?($_REQUEST:
Array
(
[__utma] => 80321045.1702299927.1320659556.1324893959.1324903157.192
[__utmz] => 80321045.1324893959.191.32.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=מסעדת הזקן והים
[Drupal_toolbar_collapsed] => 0
[Drupal_tableDrag_showWeight] => 0
[has_js] => 1
[__utmc] => 80321045
[EnvoUserInstance47374] => pa00EY4DtlM2tt
[EnvoEdgeURL47374] => edge3rx3.envolve.com
[ctools-collapsible-state] => views-ui-advanced-column-things_to_do:1,views-ui-advanced-column-resturants:1,views-ui-advanced-column-lodging:1
[SESS3716ebe320b01fc2aee2e7ff93c155f4] => j_5HO3ULjyrDbbPkRzcNd2Pf0DO3seFitibYQwLzflE
[__utmb] => 80321045.8.10.1324903157
)
REQUEST_URI:
/content/10-%D7%A2%D7%93-25-%D7%A9%D7%97/%D7%91%D7%98%D7%91%D7%A2-%D7%91%D7%9E%D7%99%D7%95%D7%97%D7%93-%D7%9C%D7%99%D7%9C%D7%93%D7%99%D7%9D-%D7%92%D7%9F-%D7%97%D7%99%D7%95%D7%A| Comment | File | Size | Author |
|---|---|---|---|
| #4 | boost-utf8-url.patch | 616 bytes | bgm |
Comments
Comment #1
imoreno commentedthis is related to pathuto + UTF8 url's, noot boost.
Comment #2
bgm commentedThanks for updating the issue. Could you provide more information about your solution? It might help people who run into the same issue.
Do we need to put a warning in the boost README? (if one day someone writes one)
Comment #3
imoreno commentedCurrently it does not works with Auto-path when using UTF8 chars in url with RTL support for Hebrew, Arabic. if I disable the search engine friendly url's all is working as expected.
Comment #4
bgm commentedNot sure if it's the same bug, but if I create an alias with non-ascii (French accents or Cyrillic letters), the page is not cached. (I could not reproduce the SQL error)
From what I understand, the URL parsed in Boost is from request_uri(), but that function does not urldecode() the data, so a request to http://www.bidon.ca/привет becomes http://www.bidon.ca/%D0%BF%D1%80%D0%B8%D0%B2%D0%B5%D1%82, and the alias cannot be found in the database.
See attached patch.
Comment #5
bgm commentedDrupal 6.x-1.x related issue #797136: utf-8 urls are not cached: filenames encoded wrongly.
Comment #6
bgm commentedAnother 7.x-1.x related issue: #1398578: Apache has problem with urlencoded query strings in cached file names
Comment #7
trante commentedI also has this problem. I installed latest dev (7.x-1.x-dev 2012-Feb-14)
My nodes having non-ASCII characters aren't cached by Boost, but non encoded nodes are cached successfully.
Comment #8
bgm commented@ trante: can you test the patch in #4 ?
Comment #9
trante commented@bgm
Thank you for interest. But the patch didn't help.
Still not caching UTF-8 aliased nodes.
Comment #10
mikeytown2 commented#4 shouldn't do much due to the urldecode loop further down on line #420. I believe the problem is somewhere else; it might have to do with the database not being UTF-8?
Comment #11
bgm commentedAt line 420, it decodes the url, but stores it in
$parts['url_decoded'], and that is barely used.In my case, e.g. create a page with an alias "testé", I have isolated the issue to the following code:
In that function, the value of $parts['path'] in my test is "test%C3%A9" (encoded), so Drupal cannot find the path for the page and eventually boost sets
$_boost['is_cacheable'] = FALSE;because of that.However, even if I put a
urldecode($parts['path'])for the drupal_get_normal_path(), Boost will generate a cache file for it, but it will be named "test%C3%A9.html". Then Apache cannot find it because mod_rewrite automatically decodes URLs and searches for "testé.html".My patch in #4 fixes that issue. The only possible caveat with my patch, is that the file name is UTF-8 on the filesystem. Normally, Linux and others should support this fine. I tested successfully with hebrew and cyrillic.
@ imoreno: I'm not sure on the initial bug report though. According to the query, it seems like correct UTF-8, except for the last caracter,
%A.. could that be the issue?Comment #12
imoreno commentedThank you BG,
With your patch from #4 all is working as expected!
both my aliased UTF-8 nodes and aliased non UTF-8 nodes are being cashed properly by boost.
I think this can be committed.
BR
Itzhak
Comment #13
bgm commentedThanks. Committed to 7.x-1.x d9d912a67c73e89dc86b4f9101fa354929ac4982
Comment #15
jamix commented#4 doesn't fix the URL encoding issue when there are special characters in the query string (as opposed to URL path). See #1398578: Apache has problem with urlencoded query strings in cached file names
Comment #16
omnia.ibrahim commentedDo you have a patch for boost version 6 ? As am having the same problem with arabic characters generated from pathauto.
Comment #17
Anonymous (not verified) commentedBoost 6 is much more complex than 7 and has some advanced options that you might need to test first
BOOST_SET_FILE_ENCODINGis under one of them and at line 3722 in boost.module there is already a character conversion
the main question would be as to which format the url string is in at this point, whether the arabic characters are urlencoded or not, but the patch for 7 was quite simple and added a urldecode if you are getting characters in the cached filenames like %D0 then it probably needs adding just after that point.
Comment #18
omnia.ibrahim commentedThanks Philip, but i can't get what do you mean by "BOOST_SET_FILE_ENCODING"?
Now my problem is that any page with arabic url is not cached at all, no file is created for it.
Comment #19
Anonymous (not verified) commentedI only came to the project after 7 had been released so don't have a 6 installation to hand at the moment.
Having looked through the 6 source code there appears to be an advanced option that should be set somewhere in the boost admin options where you can change the character set. The character set conversion starts when it is set to something other than UTF-8 and may not be what is needed (it's very difficult to tell as an english person with everything set up for European characters), probably to debug it you need to find out what is going in and coming out of the boost.module function (Approx. line 4416)
by printing it to a text file in the cache folder, although it may not be precise as your text editor may handle the characters differently (I recently had quite a problem with Thai characters cut and pasted into a text box then submitted to a database with columns in latin-1 and the output was haphazard across web pages and the terminal) .
The first stage does seem to be working out if what is going into the function is undergoing any kind of conversion, then what the conversion should be. I suspect a urldecode needs to be placed in that function although I can't hazard a guess as to whether it is to be placed early or late as there is code in there to remove special characters that the file system cannot handle. It's also probably worth examining the table boost_cache in the database as there is a column for the filename that boost 6 thinks it is storing.
Comment #20
omnia.ibrahim commentedNow when i changed the value in BOOST_SET_FILE_ENCODING to cp1256 (for arabic), the files are saved but with wrong encodings + not retrieved back correctly, any idea how to fix it?
Comment #21
Anonymous (not verified) commentedDoes this mean that your file name are being saved with the correct arabic alphabet because that's rather interesting if that is happening.
You could enable RewriteLog and RewriteLogLevel to see what files apache is looking for http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html
Comment #22
omnia.ibrahim commentedNoo the files are saved with wrong encoded characters, not arabic
Comment #23
Anonymous (not verified) commentedThat's not so good then, but at least something was saved. I'd suggest reverting back to UTF-8 and then under that section in boost module doing a url decode and seeing if it saves out a file.
Comment #24
omnia.ibrahim commentedyessssssssss workeddddd thanksssssssssssssssssssssssss :))))))