Drupal uses utf8 as character set, vBulletin uses latin1 by default. From MySQL 4.1 and up the database connection is initialized to user a given characterset. This can cause potential problems when data is saved from within the Drupal space to vBulletin tables.
This hotfix changes the character set to utf8 before executing a Drupal database query and resets it afterwards.
Problem description:
When a node is created and comments are enabled a thread is created in the forum. During thread creation the forum information is also updated to contain information about the latest thread. The forum information is cached in the datastore table as an optimization.
When the forum information contains non ascii characters and when the vBulletin database tables are not utf8 the forum information record will become corrupted because it is stored as utf8 instead of the original character set. When vBulletin creates a connection with the database it doesn't use utf8 and therefor the returned forum information record can not be unserialized.
This will result into PHP errors and missing forum information.
This problem does not happen when vBulletin completely uses utf8 or when only ascii characters are used.
The hotfix will work around the issue by only setting the database connection to use utf8 when a drupal query is executed. This, ofcourse, will add some additional overhead. The overhead can be avoided to completely convert the vBulletin data to utf8. However, at this time there is no easy, and specially no fast way, to convert vBulletin to utf8.
Applies to version:
4.7.4.0Instructions:
Download the linked database.vbulletin.inc file and overwrite the one in the drupal/includes directory.
« Download »