Closed (fixed)
Project:
Internationalization
Version:
7.x-1.x-dev
Component:
Strings
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 May 2012 at 10:49 UTC
Updated:
8 Jun 2012 at 14:41 UTC
Jump to comment: Most recent file
Comments
Comment #1
porfirio commentedAdding, changing and removing content types also give-me this error
This is getting annoying
I think i might have to stop using Drupal :(
Comment #2
nicorac commentedI'm experiencing the same bug.
After a long debug I found the bug and sent a fix here.
The bug is into Drupal core (database), not i18n module as it seems at first sight.
Closing this and marking as a duplicate of the new issue...
Comment #3
nicorac commentedReopened because I need someone helping me completing the missing steps over there.
Comment #4
jose reyero commentedDuplicating issues won't help anyone.
Comment #5
nicorac commentedI'm not really sure this is a duplicate:
- the bug is into core (
DatabaseStatement.fetchAll()method), but it was "silent" till now because nobody usedfetchAll(PDO::FETCH_CLASS, ...)till now; also there's no test created for it- the bug effects was shown by
i18n_stringmodulei18n_stringmodule contains a function (i18n_string_load_multiple) that needs to be fixed, until my (or other's) patch the core files were accepted (and backported to 7.x), otherwise node deletion is impossible.Comment #6
porfirio commentedThe problem might only occur when using SQLITE as database
In this website
http://www.sitepoint.com/forums/showthread.php?528019-PDO-FETCH_CLASS-we...
They found the same problem.
I changed i18n_string.module on line 456
return $query->execute()->fetchAll(PDO::FETCH_CLASS, 'i18n_string_object');
to:
$stmt=$query->execute();
$stmt->setFetchMode(PDO::FETCH_CLASS, 'i18n_string_object');
$result=array();
foreach($stmt as $o) {
array_push($result,$o);
}
return $result;
Might not be the best way, but it is working, at least for now...
Comment #7
nicorac commented@porfirio:
you're doing what fetchAll() function is supposed to do when called with the first parameter=PDO::FETCH_CLASS, so it's not so bad.
That's why we have 2 issues:
- core, needs a fix
- i18n_string needs a workaround (like yours) till core is fixed
Comment #8
jose reyero commentedOk. Fixing title.
Nothing to do on our side, though you can post a patch here as a temporary fix.
Comment #9
nicorac commentedLinked page in #6 was not completely related.
Our bug is in core
file includes/database/prefetch.inc, which is used by all the database drivers.On my side I have the same bug with both SQLite and MySQL, so I'll put the title back as before.
Attached is a patch with a workaround till core fix will be applied.
Comment #11
nicorac commentedFixed line endings (log says "invalid format, no more dateils...)
Comment #12
Elvar commentedNicorac, works like a charm, thank you. Out of curiosity could you tell what the issue was with the first one, seems identical :)..
Comment #13
nicorac commentedI only changed line endings format, DOS --> UNIX.
Comment #14
steinmb commentedJumped up and bit me too during site-install in my sandbox. The patch looks good to me. Let's go ahead and commit this. The official core fix if found at #1567216: DatabaseStatementPrefetch.fetchAll() implementation does not work when $fetch_style parameter is PDO::FETCH_CLASS and need reviewers.
Comment #15
boobaaPatch in #11 works for me, too.
Comment #16
jose reyero commentedOk, committed.