I receive the following error in the Drupal status report:
CiviCRM Congressional District Module
In sites/default/settings.php you must have prefixes for the following tables: civicrm_custom_field, civicrm_contact, civicrm_address, civicrm_custom_group, civicrm_uf_match, . See the CiviCRM Views Integration for more info.The following tables could not be found: civicrm_custom_field, civicrm_contact, civicrm_address, civicrm_custom_group, civicrm_uf_match.
I have attached my settings.php file (renamed, of course). You will see that I have tried with the array name as $database and $db_prefix, as it was previously in D6. For some reason the CiviCRM Views Integration page.
Comments
Comment #1
dalinFirst you create an array with the just prefixes, then you overwrite that by creating an array in the same variable with the rest of the DB connection information. Move the array with the prefixes below the array with the connection information so that nothing gets overwritten.
Comment #2
Vietyank commentedI had actually attached the wrong file. Here is the file I am using and it is set up as you said. The CiviCRM folks are saying the array should be called $database and not $db_prefix
Comment #3
dalinThis new one looks correct. Since you have multiple versions of the file around are you sure that it's reading the proper one?
As an example here's the relevant lines from my settings.php file:
You can add this at the bottom to confirm that the proper structure is being built:
Comment #4
Vietyank commentedI added that. It dumped the array to my screen. See attached.
BTW, Views Integration is working. The CCRM folks had me check that out.
Comment #5
Vietyank commentedHmmm....after I took out the debug code, the problem seems to have gone away. Still testing but I am no longer getting the error message in the status report. Perhaps something was cached, although I was clearing caches.
Comment #6
dalinComment #7
Vietyank commentedI am not getting any results from the lookups. I have an API key from Sunlight Labs and don't see any errors in the logs about the key. I have set up the two fields (Congressional District and Congressional District Override). They are both defined as 16 alphanumeric with the first being view only.
I have edited a couple of the contacts, which have been validly geocoded by Google and saved but do not see the Congressional District in the field. I've also run in batch but got no results.
Comment #8
dalinIn most cases lookups only happen on cron runs.
Comment #9
Vietyank commentedOh, so it doesn't work like CiviCRM geocoding, where it is dynamic, that is the lookup is performed when the record is saved. Let me get it straight, then. The request is queued then the lookup is performed during a cron run.
Comment #10
dalincorrect.
This decision was made so as to be nice to Sunlight. If your site has hundreds of users updating their profiles all at once (the site that I wrote this for does) it would swamp Sunlight, and possibly your website too as page generation slows down waiting for Sunlight to respond.
This is different from Google who can take a good walloping in stride.
Comment #11
Vietyank commentedI understand but now I am seeing a different problem. I batch geocoded the data with CiviCRM yesterday and all was good. Google did indeed take it in stride (about 2000) records. When I started working with your module I noticed that all of a sudden all the geocode data (lat/long) was lost and I have to geocode again. I noticed this too with Civi 3.2 but never followed up on it. Something is causing it to lose the data.
Comment #12
Vietyank commentedSorry, but I am a bit confused about the cron job. Are you referring to the Drupal cron job or a CiviCRM scheduled job?
Comment #13
Vietyank commentedI've reviewed the logs and can see that the records were processed by the cron job but I'm still not seeing the Congressional District being posted to the field I have defined. Can you suggest any debugging techniques?