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) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Can't export custom field -- shows "custom_7" instead
Pages: [1]

Author Topic: Can't export custom field -- shows "custom_7" instead  (Read 866 times)

gholt

  • I post occasionally
  • **
  • Posts: 79
  • Karma: 0
Can't export custom field -- shows "custom_7" instead
October 08, 2012, 08:22:55 pm
I'm having trouble with something that I know I was able to do last year. I'm using 3.4.5.

I search for participants, select all of the resulting participants, choose export participants, select fields for export, all of the fields are of the "individual" type, including the custom field that I want included. When I export, the resulting csv file is fine except that it has an empty column where the custom data should be, and the header for that column says "custom_7" instead of the actual name.

Doing searches based on that custom field work fine. Editing data in that custom field works fine. I've checked the settings for the field, it's enabled and searchable.

Can someone give me some tips on what might be causing this?

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Can't export custom field -- shows "custom_7" instead
October 09, 2012, 02:05:10 am
Hello there,

We have had this issue intermittently on a 3.4.7 site. Clearing CiviCRM's cache solved the problem for us.  Have you searched the forums and issue trackers for a resolution? I imagine that if people are not reporting it any more then it has been fixed / upgrading will also solve it.

Am interested to know what the issue was if you do find out any more.
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

gholt

  • I post occasionally
  • **
  • Posts: 79
  • Karma: 0
Re: Can't export custom field -- shows "custom_7" instead
October 12, 2012, 09:41:01 am
Thanks Michael. Please forgive my lack of experience, but how do I clear the CiviCRM cache? I searched the forums and documentation, and didn't come up with anything. The only cache I know how to flush is the Drupal "flush all caches" option. I tried that -- flush all caches, and that didn't change my export results.

Jason W

  • I post frequently
  • ***
  • Posts: 197
  • Karma: 12
  • jason@civitrainingtutorials.com
  • CiviCRM version: 4.2
  • CMS version: Drupal 7
  • MySQL version: 5.x
  • PHP version: 5.x.x
Re: Can't export custom field -- shows "custom_7" instead
October 12, 2012, 12:05:01 pm
Hello gholt,

I checked into it and found this:
"To reset the CiviCRM cache goto this address: civicrm/menu/rebuild&reset=1"


I also found this in the floss manual (http://en.flossmanuals.net/civicrm-developer-guide/debugging/)

Using Drupal, you can clear all caches with the drush command civicrm-cache-clear.

Alternatively, you can call the following two methods:

    CRM_Core_Config::clearDBCache();
    CRM_Core_Config::cleanup();

which clear the database and file cache respectively.
 Hope this helps.

Cheers,
Jason
civiTrainingTutorials
"Helping You Help Others"

gholt

  • I post occasionally
  • **
  • Posts: 79
  • Karma: 0
Re: Can't export custom field -- shows "custom_7" instead
October 13, 2012, 09:43:45 am
Michael, I just realized that I hadn't responded to your idea related to upgrading. We're a little nervous about upgrading so soon before an event (we have a conference coming up). I agree that this might solve our problem, but I'm hoping to come up with a short term bandaid too. Thanks!

Jason, thank you for your information. You are obviously better at searching than I am. I had searched the forums and docs, but no luck. I tried the first option you mentioned:
"To reset the CiviCRM cache goto this address: civicrm/menu/rebuild&reset=1"

No luck. And I'm not set up to use drush. I'm sure this is a stupid question, but with my lack of experience, I don't know what it means to "call" one of those two methods. Can someone please point me in the right direction? When I search for how to call something, you can imagine I come up with a lot of results that aren't very helpful.

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Can't export custom field -- shows "custom_7" instead
October 15, 2012, 01:20:02 pm
Quote
We're a little nervous about upgrading so soon before an event (we have a conference coming up). I agree that this might solve our problem, but I'm hoping to come up with a short term bandaid too. Thanks!
yeah - i am familiar with this feeling :)

Quote
To reset the CiviCRM cache goto this address: civicrm/menu/rebuild&reset=1
afaik this just rebuilds CiviCRM's menu.

I'm not sure that there is a way to easily clear CiviCRM's database cache apart from by using drush.  And what you can do does vary with the version of CiviCRM you are using.

But if you really can't use drush, then depending on your MySQL skills and your adventerousness you might want to do the following (after backing everything up, of course!!)...

The drush clear cache command is a wrapper for

CRM_Core_Config::clearDBCache();

Code: [Select]
  function clearDBCache() {
    $queries = array(
      'TRUNCATE TABLE civicrm_acl_cache',
      'TRUNCATE TABLE civicrm_acl_contact_cache',
      'TRUNCATE TABLE civicrm_cache',
      'TRUNCATE TABLE civicrm_prevnext_cache',
      'UPDATE civicrm_group SET cache_date = NULL',
      'TRUNCATE TABLE civicrm_group_contact_cache',
      'TRUNCATE TABLE civicrm_menu',
      'UPDATE civicrm_setting SET value = NULL WHERE name="navigation" AND contact_id IS NOT NULL',
      'DELETE FROM civicrm_setting WHERE name="modulePaths"', // CRM-10543
    );

    foreach ($queries as $query) {
      CRM_Core_DAO::executeQuery($query);
    }

    // also delete all the import and export temp tables
    self::clearTempTables();
  }
Calling the above queries to truncate the cache tables would be a good start. If that does not work, deleting cache tables with tables names like below...

Code: [Select]
( TABLE_NAME LIKE 'civicrm_import_job_%'
OR       TABLE_NAME LIKE 'civicrm_export_temp%'
OR       TABLE_NAME LIKE 'civicrm_task_action_temp%' )

... may also fix it.
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

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: Can't export custom field -- shows "custom_7" instead
October 15, 2012, 06:35:37 pm

note that in more recent versions (4.1 and later for sure) civicrm/menu/rebuild cleans up the cache and tempory files in addition to rebuilding the menu

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

gholt

  • I post occasionally
  • **
  • Posts: 79
  • Karma: 0
Re: Can't export custom field -- shows "custom_7" instead
October 15, 2012, 08:02:16 pm
Thanks Lobo. I look forward to benefiting from the MANY improvements in 4.1 when we can upgrade after this conference!

Michael, you are awesome! Even though I didn't have the skills to do what you suggested in your most recent message, I was able to enlist the skills of a colleague that follow those instructions. Calling those queries worked!

Thanks again!

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Can't export custom field -- shows "custom_7" instead
October 16, 2012, 02:22:37 am
Great - v. glad that that worked :)

You might want to file an issue to get

Quote
civicrm/menu/rebuild&reset=1

renamed to something more meaningful like

Quote
civicrm/clearcache&reset=1
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Can't export custom field -- shows "custom_7" instead

This forum was archived on 2017-11-26.