0

After a recent civicrm upgrade, one of my pricefields in a price set just 'disappeared'. There were no errors showing and the pricefield appeared to be correctly configured.

3

I solved this by looking in the civicrm_price_field table and noticed that the missing price field had an expiry date of '000-00-00 00:00:00' vs. NULL for other expiry dates. Setting the price field expiry to NULL allowed the price field to be redisplayed.

On the configuration screen, those two values both appear the same.

Conclusion: a '0000-00-00 00:00:00' in a price field row expiry field should be considered invalid/error.

5
  • We just found that similar happened. User remove an 'old' Expiry Date (according to the logs) and bingo it broked. will push a PR today hopefully
    – petednz - fuzion
    Oct 8 '20 at 1:38
  • ok. more specifically the problem can be caused by having a price field with an expire Date/Time, and then removing the Date by clicking in to it, rather than using the X - therefore leaving the Time behind eg as 00:00 - which i guess puts it pretty close to the Big Bang :-)
    – petednz - fuzion
    Oct 8 '20 at 21:56
  • am suggesting that if a fix is hard, then at least a warning on Submit if date is empty but Time is not
    – petednz - fuzion
    Oct 8 '20 at 21:56
  • 0000-00-00 00:00:00 wouldn't be the big bang, more like year 0 CE.
    – Alan Dixon
    Oct 9 '20 at 20:49
  • A warning on submit wouldn't deal with old bad data, we'd need one of those system check thingys to warn about that also.
    – Alan Dixon
    Oct 9 '20 at 20:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.