CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • DB hacked changes not recognized
Pages: [1]

Author Topic: DB hacked changes not recognized  (Read 817 times)

joecivi

  • I’m new here
  • *
  • Posts: 9
  • Karma: 0
DB hacked changes not recognized
January 28, 2010, 09:55:50 pm
Hi Folks,

I'm new to CiviCRM (and think it's great), and have been hacking Drupal for a while.

I wrote some perl scripts that dig directly into the DB for customization a client needed. I wrote the data I needed to, but Civi doesn't realize that  ;) I'm filling custom data fields.
In Drupal, you sometimes have to do an update and kick things to have changes read and caches flushed. How do I do something like that in Civi? The data is there when I go to edit the custom fields, but isn't displayed when initially viewing.

Thanx and keep up the great work.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: DB hacked changes not recognized
January 29, 2010, 08:10:04 am

are you just adding data to the custom field tables?, i.e. insert/update/delete on the civicrm_value_* tables? or are you adding or removing custom fields

if the former, you dont need to do anything (i do that a fair amount in some of my code). If it does not show up, it most likely is a wrong format

if the latter, please do a "truncate civicrm_cache;" after a modification (there are more efficient ways of doing that)

Code: [Select]
        // reset the cache                                             
        require_once 'CRM/Core/BAO/Cache.php';
        CRM_Core_BAO_Cache::deleteGroup( 'contact fields' );

lobo

A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

joecivi

  • I’m new here
  • *
  • Posts: 9
  • Karma: 0
Re: DB hacked changes not recognized
January 29, 2010, 09:13:44 am
Glad to hear I didn't transgress too far  ;D

I didn't add any fields, just updated existing fields. Problem was system didn't realize it.

Before editing, no address was shown. When I went to edit, I saw correct address info I'd perled in. Once saved all was groovy. I think it has something to do with the civicrm_log not being updated and the system using old data? The civicrm_cache is very sparse: only 38 entries, so that's not storing that much. Is info cached elsewhere? I updated thousands of address records. Is there a way to amnesiaize the system and have it reread all contact data?

Thanx.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • DB hacked changes not recognized

This forum was archived on 2017-11-26.