jDiction Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

jDiction 2.2.0 released. http://jdiction.org/downloads

Author Topic: Compatibility with Fabrik  (Read 11135 times)

xgon

  • Newbie
  • *
  • Posts: 16
    • View Profile
Compatibility with Fabrik
« on: April 09, 2016, 01:10:37 pm »

Hello,

I have a site with Jdiction that now I need Fabrik too.

I've installed Fabrik and it seems that it needs a database driver also. Can we have both drivers running at the same time?

Thanks.
Logged

Harald Leithner

  • Administrator
  • Hero Member
  • *****
  • Posts: 1688
    • View Profile
Re: Compatibility with Fabrik
« Reply #1 on: April 09, 2016, 05:25:51 pm »

You can change the core of jdiction to use the others database driver.but this will break on each jdiction upgrade
Logged
Joomla! 5.0 Release Manager
Vote at JED

xgon

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: Compatibility with Fabrik
« Reply #2 on: April 11, 2016, 01:01:25 am »

where can I change this? Thanks.
Logged

Harald Leithner

  • Administrator
  • Hero Member
  • *****
  • Posts: 1688
    • View Profile
Re: Compatibility with Fabrik
« Reply #3 on: April 11, 2016, 10:35:28 am »

There are two ways:

1. change the extends of JdDatabaseAdapter from JDatabaseDriverMySQLi to JDatabaseDriverMySQLi_Fab in the file libraries/jdiction/database/driver/mysqli.php you maybe have to load the fab database driver file before with require_once(JPATH_SITE.'/components/com_fabrik/driver/mysqli_fab.php');

2. add the following code to the JdDatabaseAdapter class in libraries/jdiction/database/driver/mysqli.php

Code: [Select]
public function replacePrefix($sql, $prefix = '#__')
{
$app = JFactory::getApplication();
$package = $app->getUserStateFromRequest('com_fabrik.package', 'package', 'fabrik', 'cmd');

if ($package == '')
{
$package = 'fabrik';
}

$sql = str_replace('{package}', $package, $sql);

return parent::replacePrefix($sql, $prefix);
}
Logged
Joomla! 5.0 Release Manager
Vote at JED