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 CiviCase (Moderator: Dave Greenberg) »
  • Bug when exporting case with customized-activity
Pages: [1]

Author Topic: Bug when exporting case with customized-activity  (Read 1421 times)

Rémi

  • Guest
Bug when exporting case with customized-activity
September 15, 2010, 09:20:14 am
Hello everybody.

here is the bug I noticed :

frequency : always
context : say you have a case type with 2 activities inside (A and B)
And say A as custom fields that B doesn't have.
Then when trying to export cases, and selecting this custom fields to be exported, the export is all wrong (duplicates rows, custom fields content duplicated sometime)

Note : when exporting activitiesfrom the activity search, no problem (but we can't know the name of the related case )

Anybody encountered this bug/Knows how to deal with it?
I guess it is related to some sql querry (like a wrong Join, external where it should be internal)
It is really anoying

Rémi
« Last Edit: September 15, 2010, 09:31:00 am by Rémi »

demeritcowboy

  • Ask me questions
  • ****
  • Posts: 570
  • Karma: 42
  • CiviCRM version: Always the latest!
  • CMS version: Drupal 6 mostly, still evaluating 7.
  • MySQL version: Mix of 5.0 / 5.1 / 5.5
  • PHP version: 5.3, usually on Windows
Re: Bug when exporting case with customized-activity
September 15, 2010, 09:30:12 am
Does the activity have revisions? You maybe only want to export ones with is_current_revision=1 and is_deleted=0

Rémi

  • Guest
Re: Bug when exporting case with customized-activity
September 15, 2010, 09:32:05 am
no revision at all except for one
my export file is about 350 rows for less than 10 activities
 :o

demeritcowboy

  • Ask me questions
  • ****
  • Posts: 570
  • Karma: 42
  • CiviCRM version: Always the latest!
  • CMS version: Drupal 6 mostly, still evaluating 7.
  • MySQL version: Mix of 5.0 / 5.1 / 5.5
  • PHP version: 5.3, usually on Windows
Re: Bug when exporting case with customized-activity
September 15, 2010, 09:37:50 am
Ok. Can you clarify what you mean by "export"? Is this a SQL query, a function in civi, etc?

Rémi

  • Guest
Re: Bug when exporting case with customized-activity
September 15, 2010, 09:39:10 am
the export action you find in the find a case page =)
The bug appends on the demo site (try to export cases with the settings ''testBugExport'' )
( 1000+ rows for about 10 cases )
« Last Edit: September 15, 2010, 09:45:00 am by Rémi »

demeritcowboy

  • Ask me questions
  • ****
  • Posts: 570
  • Karma: 42
  • CiviCRM version: Always the latest!
  • CMS version: Drupal 6 mostly, still evaluating 7.
  • MySQL version: Mix of 5.0 / 5.1 / 5.5
  • PHP version: 5.3, usually on Windows
Re: Bug when exporting case with customized-activity
September 15, 2010, 09:54:29 am
Hmm, didn't know that existed. Don't know what the original use-case was.

What are you expecting as the output when you join the three tables? Are you expecting three output files? Are you expecting a flattened list with one row for each activity and the case/contact details repeated on each of those rows? Some sort of hierarchical output? Other?

Rémi

  • Guest
Re: Bug when exporting case with customized-activity
September 15, 2010, 10:04:34 am
I was just trying to export all the activities related to case, and some custom fields for activities witch have custom fields.
That is I want :
all cases related to a defined contact type
all activities related to these cases
when its available, the value of custom fields of activities.

The results would be a row for each activity , and details about case, contact, custom field in column (blanck or filled )


It seems really straight forward to me. Just a big export.

Rémi  ::)
« Last Edit: September 15, 2010, 10:06:45 am by Rémi »

demeritcowboy

  • Ask me questions
  • ****
  • Posts: 570
  • Karma: 42
  • CiviCRM version: Always the latest!
  • CMS version: Drupal 6 mostly, still evaluating 7.
  • MySQL version: Mix of 5.0 / 5.1 / 5.5
  • PHP version: 5.3, usually on Windows
Re: Bug when exporting case with customized-activity
September 15, 2010, 10:11:36 am
Ok. I can confirm that you aren't doing anything wrong, but whatever the use-case was for this export feature doesn't seem to support what you are looking for.

So some options:
1) Manipulate the export you have now with a macro.

2) Do three separate exports one table at a time and combine in your spreadsheet program as desired.

3) Do a SQL query from the database directly.

4) Submit a patch for this feature / see if anyone else has a similar need.

Rémi

  • Guest
Re: Bug when exporting case with customized-activity
September 15, 2010, 10:24:21 am
The export is obviously wrong as it indicates that some activities have custom fields value they don't have at all. (so clearly this is a bug, as the export return things that don't exist in DB)

Beside, in my opinion, what is the use of being able to select activity custom fields in export if this is bogus.

So I'll recommend to either take the activity custom fields out of the export list, or fix this (again, probably change the join type).

I'm currently using OO Base to execute query in a graphical way, and I was looking for another solution has it is really painful and nearly impossible to maintain over time. ( In the end its like remapping every relations between civicrm tables, and this work as already been done by the mighty developers. )

So if anybody just need a raw list of activities in for-export-selected-cases with their custom field, I'll recommend NOT to use any SQL querry, neither use macro, but instead to use civicrm export function to custom tailor it (this should win you several time !) (thinking about the DAO stuff)

Rémi


Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviCase (Moderator: Dave Greenberg) »
  • Bug when exporting case with customized-activity

This forum was archived on 2017-11-26.