Hello Folks,
I have been trying to integrate views with CIVICRM data in my backdropcms site, but failed. I followed the backdropcms documentation https://docs.civicrm.org/sysadmin/en/latest/integration/backdrop/views following all mentioned steps but its showing me SQLSTATE[42S02]: Base table or view not found: 1146 Table 'xxxx.civicrm_event' doesn't exist. Please note that i have separated backdrop and civicrm databases where xxx is the db prefix for backdrop database.
Please help me. Thanks in advance!
Rajib Paul
Comments
Hi Rajib, and welcome! I would start here:
Can you post back here to let me know if that solves it, or not? (And if not, can you post sanitized versions of the relevant code from civicrm.settings.php)
@laryn - Rajib is a colleague of mine and we are working together on this. We used the instructions here: https://docs.civicrm.org/sysadmin/en/latest/integration/backdrop/views/ We also tried the link you shared. None of that is helping.
See screenshot and note our Backdrop database = tcog2 and CiviCRM database should be = tcog2_civicrm
Does the error message suggest that it's not looking in the right database.
We have copied all the database prefixes into settings.php AND made the modification to the credentials.
$databases['default']['default'] = array( 'driver' => 'mysql', 'database' => 'tcog2', 'username' => 'tcog', 'password' => 'fake1234', 'host' => 'localhost', );
@rajpaul03 @stpaultim,
Can you post the first few lines of the CiviCRM Views integration code that you pasted at the bottom of settings.php?
This is the start and end of the block of table prefix's that we copied into settings.php.
Could you try changing this:
To this:
And if it works, chime in here:
Actually FIRST could you try removing the backticks from around all occurrences of
See: https://github.com/backdrop/backdrop-issues/issues/4745
I removed the backticks first and that did not solve the problem. I then changed
"$database_prefix = array("
to
" $databases['default']['default']['prefix']= array(". After the second suggestion, it worked.
I then tried to restore the backticks, just to be clear about which suggestion was the solution and with the backticks, it did not work. It would appear that both suggestions were required for us to get this working.