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) »
  • Exporting Price Set Fields
Pages: [1] 2

Author Topic: Exporting Price Set Fields  (Read 2319 times)

joverton58

  • Guest
Exporting Price Set Fields
May 17, 2010, 10:30:19 am
Hi,

Does anyone know if there is a way to export the information in a Price Set for an Event.  I was able to export the total Fee, but not the individual information.  I have several items in the price set that are a quantity the participant has ordered (additional t-shirts for example), but I cannot seem to get that field to show up anywhere in the export.

Any help would be greatly appreciated.

Thanks,

John

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: Exporting Price Set Fields
May 17, 2010, 01:12:22 pm

check the price set custom search, does what you need :)

http://drupal.demo.civicrm.org/civicrm/contact/search/custom/list?reset=1
http://drupal.demo.civicrm.org/civicrm/contact/search/custom?csid=9&reset=1 (note demo does not have price sets and hence the error)

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

mhm

  • I post occasionally
  • **
  • Posts: 82
  • Karma: 2
Re: Exporting Price Set Fields
May 17, 2010, 09:51:41 pm
Seems like just what I need -- except I get an error:

Quote
unrecoverable error
    Sorry. A non-recoverable error has occurred.

    DB Error: no such field

    Database Error Code: Unknown column 'price_field_450' in 'field list', 1054

    Return to home page.


Code: [Select]
Error Details:

Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -19
    [message] => DB Error: no such field
    [mode] => 16
    [debug_info] =>
UPDATE civicrm_temp_custom_24cdc21d4204eb64b322dc396a21ec36
SET price_field_450 = 1
WHERE participant_id = 9;
 [nativecode=1054 ** Unknown column 'price_field_450' in 'field list']
    [type] => DB_Error
    [user_info] =>
UPDATE civicrm_temp_custom_24cdc21d4204eb64b322dc396a21ec36
SET price_field_450 = 1
WHERE participant_id = 9;
 [nativecode=1054 ** Unknown column 'price_field_450' in 'field list']
    [to_string] => [db_error: message="DB Error: no such field" code=-19 mode=callback callback=CRM_Core_Error::handle prefix="" info="
UPDATE civicrm_temp_custom_24cdc21d4204eb64b322dc396a21ec36
SET price_field_450 = 1
WHERE participant_id = 9;
 [nativecode=1054 ** Unknown column 'price_field_450' in 'field list']"]
)
[/code]

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: Exporting Price Set Fields
May 18, 2010, 08:46:44 am

your best bet will be to debug that code and file a patch that fixes the issue. If you are not a developer consider hiring one from http://civicrm.org/professional/

Please create an issue and submit your patch back so others can benefit

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

mhm

  • I post occasionally
  • **
  • Posts: 82
  • Karma: 2
Re: Exporting Price Set Fields
June 10, 2010, 09:45:46 pm
We discovered this too close to our event to deal with it in any major way. Hiring a developer would have required board approval, and we didn't have time, so exported to Excel and did it by hand (not fun, but for <150 participants, doable).
Is there a chance this has been fixed in the 3.2 version, or that it can be added to bug fixes needed?

mariagwyn

  • I post frequently
  • ***
  • Posts: 149
  • Karma: 4
  • CiviCRM version: CiviCRM 3.3.3
  • CMS version: Drupal 6.20
  • MySQL version: 5.2.14
  • PHP version: 5.0.91-50-log
Re: Exporting Price Set Fields
August 25, 2010, 12:15:09 pm
I just discovered this search which we need for an upcoming conference.  When I go to the custom search and search by event, a table is built with all the price set options and columns and participants listed as rows.  The problem is that the actual price data is "0" in all cases, even when I am 100% (and can confirm in participant event screen) that an option/amount was chosen.  In otherwords, I have a nicely constructed but completely empty table.

No error is registered that I can see (I have debugging and backtrace enabled).  This is a very important feature for my client.  Any ideas how to get actual data in the table?

Many thanks,
Maria

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: Exporting Price Set Fields
August 25, 2010, 12:24:06 pm

your best bet would be to check the queries generated and see where the bug is. Please do submit back the fixes so others can benefit.

i suspect its a fairly small bug, but have not looked at that code in some time

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

mariagwyn

  • I post frequently
  • ***
  • Posts: 149
  • Karma: 4
  • CiviCRM version: CiviCRM 3.3.3
  • CMS version: Drupal 6.20
  • MySQL version: 5.2.14
  • PHP version: 5.0.91-50-log
Re: Exporting Price Set Fields
August 25, 2010, 12:37:06 pm
can you start me out by telling me how/where to look for these queries?  Where is this custom search php stored?  

edit: never mind, found the PriceSet.php.  any other hints welcome, about to start messing around.
« Last Edit: August 25, 2010, 12:39:13 pm by mariagwyn »

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: Exporting Price Set Fields
August 25, 2010, 12:39:50 pm

you might want to read:

http://en.flossmanuals.net/CiviCRM/DevelopIntro
http://civicrm.org/architecture

might also want to consider installing and using the drupal devel module

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

mariagwyn

  • I post frequently
  • ***
  • Posts: 149
  • Karma: 4
  • CiviCRM version: CiviCRM 3.3.3
  • CMS version: Drupal 6.20
  • MySQL version: 5.2.14
  • PHP version: 5.0.91-50-log
Re: Exporting Price Set Fields
August 25, 2010, 02:31:40 pm
This may be more than I can do without serious help, but so far this is what I have figure out:

1.  Created a custom search based on existing search, works as the other one.
2.  The "buildTempTable" function works fine.  It outputs column names and rows correctly.  Column names are taken from the field names of price set.
3.  The problem appears to be in the "fillTable" function. It is not outputting the "unit_price" values from the "line_item" table.  These values are listed there, and they are linked with an entity_id which is correctly called by the form in creating the rows.

I have attached both a txt file containing the results table and the relevant queries.  I have also attached the custom search form.  I will keep plugging away. 

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: Exporting Price Set Fields
September 02, 2010, 07:46:18 pm

maria:

did u get to the bottom of this one? if so, can u please share your solution

thanx

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

mariagwyn

  • I post frequently
  • ***
  • Posts: 149
  • Karma: 4
  • CiviCRM version: CiviCRM 3.3.3
  • CMS version: Drupal 6.20
  • MySQL version: 5.2.14
  • PHP version: 5.0.91-50-log
Re: Exporting Price Set Fields
September 03, 2010, 09:03:21 am
not yet.  I will share once I have it.  I think that the joins are wrong, but I am not a mysql person so I have hired a friend.  I am not sure why it is working on the demo but not on mine.  It makes me wonder if the  joins aren't pulling in hierarchical price sets.

Neil Adair

  • I post occasionally
  • **
  • Posts: 78
  • Karma: 4
  • CiviCRM version: 4.5.8
  • CMS version: Drupal 7
  • MySQL version: MariaDB 10
  • PHP version: 5.5 FPM
Re: Exporting Price Set Fields
September 19, 2010, 12:48:40 pm
I have the same issue and it has been reported and fixed before in CiviCRM 2.1 when it was broken in an upgrade.
I have filed an issue with links to the previous one and a link to the demo where I reproduced it.

see http://issues.civicrm.org/jira/browse/CRM-6848

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: Exporting Price Set Fields
September 19, 2010, 07:52:29 pm

Neil:

if the below issue is important for you, please investigate the code and contribute a patch. That will help ensure it gets into the next 3.2.x release

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

Neil Adair

  • I post occasionally
  • **
  • Posts: 78
  • Karma: 4
  • CiviCRM version: 4.5.8
  • CMS version: Drupal 7
  • MySQL version: MariaDB 10
  • PHP version: 5.5 FPM
Re: Exporting Price Set Fields
September 20, 2010, 08:13:53 am
Yes, it is kind of important but it is more effective to properly report the issue and have the wizards in India find the problem and fix it than trying to fix it myself (unlikely) or hire a programmer to investigate (expensive).

The issue has now been fixed by Sushant Paste, kudos and many thanks! see
https://fisheye2.atlassian.com/viewrep/CiviCRM/branches/v3.2/CRM/Contact/Form/Search/Custom/PriceSet.php?r1=28934&r2=29722

It was in fact a single character, typo? Line 133 of /civicrm/CRM/Contact/Form/Search/Custom/PriceSet.php

"o.id = l.entity_id" should be "p.id = l.entity_id"

The fix passed quality control and I've tested it myself on 2 sites which are Drupal/CiviCRM 3.2.3 Multilanguage English/français

A 12 hour turnaround! Amazing  :)

Thanks again!

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Exporting Price Set Fields

This forum was archived on 2017-11-26.