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 »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Gotcha (+ solution) for broken auto-complete fields in reports post-4.5 upgrade
Pages: [1]

Author Topic: Gotcha (+ solution) for broken auto-complete fields in reports post-4.5 upgrade  (Read 531 times)

GinkgoFJG

  • I post frequently
  • ***
  • Posts: 135
  • Karma: 4
    • Ginkgo Street Labs
Gotcha (+ solution) for broken auto-complete fields in reports post-4.5 upgrade
December 26, 2014, 09:37:43 am
I just completed an upgrade for a client (from 4.3.x to 4.5.x), and I noticed some funny behavior in a report based off the Attendee List event report template. When I try to filter by event (all I have to do is click in the box), the form field tries to do an auto-complete, fails, then doesn't let me enter any more text. (This field now uses the select2 widget.)

I took a look at the row of civicrm_report_instance that corresponds to the instance in question, and in the form_values field which contains a ton of serialized form data, I noticed that event_id_value had a value of "1" (s:1:"1"). When I wiped this out (s:0:""), the problem was resolved. Event id 1 no longer exists in the database; I think select2 didn't know what to do with a nonexistent record, so it choked.

On the one hand, it's questionable whether such reports are worth saving; it's unlikely clients are using reports that reference nonexistent entities. On the other hand:
  • it doesn't look good on the upgrade process,
  • an "abandoned" report can be updated or copied and find new life,
  • it may be easy to tell select2 to disregard the default value if the option doesn't exist

Or... maybe this is a really isolated incident and doesn't merit further attention. Discuss!
Are you a CiviVolunteer user? Join the CiviVolunteer 2.0 Matching Grant effort to help the project win $15,000 in grant funding.

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Gotcha (+ solution) for broken auto-complete fields in reports post-4.5 upgrade
December 26, 2014, 10:17:48 am
Not sure if it's select2 or the api that's doing the choking. I do think that adding a "safety check" somewhere in there would be a good idea, probably the approach would be to wipe any invalid values from an entityRef field before rendering it.
Try asking your question on the new CiviCRM help site.

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Gotcha (+ solution) for broken auto-complete fields in reports post-4.5 upgrade
January 09, 2015, 07:09:18 am
Fixed it: https://issues.civicrm.org/jira/browse/CRM-15803
Try asking your question on the new CiviCRM help site.

GinkgoFJG

  • I post frequently
  • ***
  • Posts: 135
  • Karma: 4
    • Ginkgo Street Labs
Re: Gotcha (+ solution) for broken auto-complete fields in reports post-4.5 upgrade
January 09, 2015, 08:17:50 am
Nice.
Are you a CiviVolunteer user? Join the CiviVolunteer 2.0 Matching Grant effort to help the project win $15,000 in grant funding.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Gotcha (+ solution) for broken auto-complete fields in reports post-4.5 upgrade

This forum was archived on 2017-11-26.