bhuisgen / rc-vacation

Vacation plugin for RoundCube Webmail
http://blog.hbis.fr/softwares/rc-vacation/
GNU General Public License v2.0
33 stars 37 forks source link

vacation plugin not compatible with roundcube 0.9 beta #16

Open sblaisot opened 11 years ago

sblaisot commented 11 years ago

Hi,

Due to changes in the way roundcube access database in the 0.9 beta version, the forward plugin doesn't work anymore starting with this version.

Error log says : PHP Fatal error: Class 'rcube_mdb2' not found in /plugins/vacation/lib/drivers/sql.php on line 34 this is related with the following changelog line of roundcube 0.9 :

Another major change is the new database abstraction. In order to add support for SQLite3 the PEAR:MDB2 dependency was dropped and Roundcube now uses the native PHP Data Objects (PDO). ATTENTION: due a small lack in the MySQL PDO driver this version of Roundcube requires PHP 5.3 when using the MySQL database.

A workaround is to replace $db = new rcube_mdb2($dsn, '', FALSE); by

            if (!class_exists('rcube_db')) {
                $db = new rcube_mdb2($dsn, '', FALSE);
            } else {
                $db = rcube_db::factory($dsn, '', FALSE);
            }

regards,

S.B.

web0127g commented 11 years ago

hi, I created a patch which replaces the above suggested code lines in lib/virtual.class.php this makes it run under roundcube-0.9.2 https://sourceforge.net/p/rcubevacation/patches/20/

have fun!