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) »
  • Problem updating Price Set options for events
Pages: [1]

Author Topic: Problem updating Price Set options for events  (Read 2074 times)

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
Problem updating Price Set options for events
March 19, 2009, 08:52:33 am
I am working with Price sets for an event and went on a little Civi adventure.  I tried to update the name and value for a radio option but Civi silently failed.

I thought a work around would be to delete and start again and when I tried to delete it, but was told I couldn't because it was in use.  Civi (very kindly) sent me a link to the event fees page and I disabled it.

So I thought that now that it wasn't in use, I could try and rename it, but still it silently failed again.  So, in the end, I deleted the option and made a new one with the correct values and that worked.

So, problem solved and one bug to report (that I don't have time to replicate on the demo right now - sorry).

It also lead me to some further thoughts:

Are you meant to be able to update price sets and add options to price sets for *current* events?  If not then you are missing a warning.  If so then why can't you delete them? It seems like it would cause a similar amount of disruption.

Michael
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

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: Problem updating Price Set options for events
March 19, 2009, 09:08:39 am
By the way, I'm getting some other funny behaviours - i know that it would be really helpful if I could repeat on sandbox, but just in case this is of use.

The price set field isn't updating properly all the time - I think sometimes it takes a couple of refreshes, and every now and again I get this bracktrace.

It's Joomla and 2.1.6 btw.

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

    [code] => -2
    [message] => DB Error: syntax error
    [mode] => 16
    [debug_info] => UPDATE civicrm_option_value SET weight = weight + 1 WHERE id != 238 AND weight < 10 AND option_group_id = (SELECT id FROM civicrm_option_group WHERE name = \'civicrm_price_field.amount.1\') [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\'civicrm_price_field.amount.1\')' at line 1]
    [type] => DB_Error
    [user_info] => UPDATE civicrm_option_value SET weight = weight + 1 WHERE id != 238 AND weight < 10 AND option_group_id = (SELECT id FROM civicrm_option_group WHERE name = \'civicrm_price_field.amount.1\') [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\'civicrm_price_field.amount.1\')' at line 1]
    [to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix="" info="UPDATE civicrm_option_value SET weight = weight + 1 WHERE id != 238 AND weight < 10 AND option_group_id = (SELECT id FROM civicrm_option_group WHERE name = \'civicrm_price_field.amount.1\') [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\'civicrm_price_field.amount.1\')' at line 1]"]
)
[/code]
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

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: Problem updating Price Set options for events
March 19, 2009, 02:32:34 pm
Reproduced on the joomla demo (good job i brushed up on my italian) ...

first of all, when i saved my price set called 'fees', it told me that it already existed, so i added an x.  you'll see that there are now two price sets fees and feesx.  this happened to me a couple of times before.

then i added some radio buttons and  started moving things round and it worked at first but then i got this error

Code: [Select]
Spiacenti, il sistema ha avuto un errore non rimediabile.
DB Error: syntax error

Codice errore database: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\'civicrm_price_field.amount.1\')' at line 1, 1064

Torna alla home page.

Error Details:

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

    [code] => -2
    [message] => DB Error: syntax error
    [mode] => 16
    [debug_info] => UPDATE civicrm_option_value SET weight = weight + 1 WHERE id != 259 AND weight < 4 AND option_group_id = (SELECT id FROM civicrm_option_group WHERE name = \'civicrm_price_field.amount.1\') [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\'civicrm_price_field.amount.1\')' at line 1]
    [type] => DB_Error
    [user_info] => UPDATE civicrm_option_value SET weight = weight + 1 WHERE id != 259 AND weight < 4 AND option_group_id = (SELECT id FROM civicrm_option_group WHERE name = \'civicrm_price_field.amount.1\') [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\'civicrm_price_field.amount.1\')' at line 1]
    [to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix="" info="UPDATE civicrm_option_value SET weight = weight + 1 WHERE id != 259 AND weight < 4 AND option_group_id = (SELECT id FROM civicrm_option_group WHERE name = \'civicrm_price_field.amount.1\') [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\'civicrm_price_field.amount.1\')' at line 1]"]
)
at this URL
Code: [Select]
http://joomla.demo.civicrm.org/administrator/index2.php?option=com_civicrm&task=civicrm/admin/weight&reset=1&dao=CRM_Core_DAO_OptionValue&idName=id&url=index2.php%3Foption%3Dcom_civicrm%26amp%3Btask%3Dcivicrm%2Fadmin%2Fprice%2Ffield%2Foption%26amp%3Baction%3Dbrowse%26amp%3Breset%3D1%26amp%3Bfid%3D1%26amp%3Bsid%3D1&filter=option_group_id+%3D+%28SELECT+id+FROM+civicrm_option_group+WHERE+name+%3D+%27civicrm_price_field.amount.1%27%29&src=259&dst=257&dir=first
now when i try and add a price set it doesn't work, editing sliently fails as before, etc.[/code]
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

alanski

  • I post frequently
  • ***
  • Posts: 216
  • Karma: 5
  • Cup of tea? Yes please
    • Joomkit
  • CiviCRM version: Version in post
  • CMS version: Joomla
  • MySQL version: 5.0
Re: Problem updating Price Set options for events
March 24, 2009, 03:15:54 am
Now I can see this too!

Thanks Michael

Does 2.2 fix this I wonder...off to bug tracker

alanski

  • I post frequently
  • ***
  • Posts: 216
  • Karma: 5
  • Cup of tea? Yes please
    • Joomkit
  • CiviCRM version: Version in post
  • CMS version: Joomla
  • MySQL version: 5.0
Re: Problem updating Price Set options for events
March 24, 2009, 04:48:44 am
OK So I upgraded the install to 2.2 and tried to delete a fee for an event that is not currently being used by an event and got this.

backTrace

/administrator/components/com_civicrm/civicrm/CRM/Core/Error.php, backtrace, 258
/administrator/components/com_civicrm/civicrm/CRM/Core/BAO/PriceSet.php, fatal, 231
/administrator/components/com_civicrm/civicrm/CRM/Price/Page/Option.php, getUsedBy, 182
/administrator/components/com_civicrm/civicrm/CRM/Price/Page/Option.php, edit, 261
/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php, run, 205
/administrator/components/com_civicrm/admin.civicrm.php, invoke, 45
/administrator/components/com_civicrm/admin.civicrm.php, civicrm_invoke, 22


/libraries/joomla/application/component/helper.php, require_once, 162
l/administrator/includes/application.php, renderComponent, 136
/administrator/index.php, dispatch, 67
/administrator/index2.php, include, 14

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

    civicrm_event_page is not supported in PriceSet::usedBy()

    Return to home page.


alanski

  • I post frequently
  • ***
  • Posts: 216
  • Karma: 5
  • Cup of tea? Yes please
    • Joomkit
  • CiviCRM version: Version in post
  • CMS version: Joomla
  • MySQL version: 5.0
Re: Problem updating Price Set options for events
March 24, 2009, 05:12:58 am
It seems there is a problem with saving a new price field when the order value already exists.
If I bump up the weight value to a new one it gets saved. If editing a  value and the weight is set sometimes the value does not show when saved or it refuses to save, staying on the price field add/edit screen.

hth

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: Problem updating Price Set options for events
March 24, 2009, 06:32:44 am
Quote from: alanski on March 24, 2009, 04:48:44 am
    civicrm_event_page is not supported in PriceSet::usedBy()

    Return to home page.

this is fixed in 2.2.1. For folks that have already upgraded there needs to be some manual db updates. Check this thread

http://forum.civicrm.org/index.php/topic,7097.0.html

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

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: Problem updating Price Set options for events
March 24, 2009, 06:34:44 am
Quote from: alanski on March 24, 2009, 05:12:58 am
It seems there is a problem with saving a new price field when the order value already exists.
If I bump up the weight value to a new one it gets saved. If editing a  value and the weight is set sometimes the value does not show when saved or it refuses to save, staying on the price field add/edit screen.

please file an issue and we'll fix in a future release (2.2.1 or 2.3.0) depending on the complexity of the fix. If important to you, contribute a patch that fixes the issue

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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Problem updating Price Set options for events

This forum was archived on 2017-11-26.