Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-18069

Custom field DataTables invalid JSON error when sorting columns

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 4.7.1
    • Fix Version/s: None
    • Component/s: Core CiviCRM
    • Labels:
    • Documentation Required?:
      None
    • Funding Source:
      Needs Funding

      Description

      If at least two custom field groups exist for contacts, with multiple records and display as tab with table, then the second custom field group will give an error when attempting to sort its table on some/all columns:
      DataTables warning: table id=records-10 - Invalid JSON response. For more information about this error, please see http://datatables.net/tn/1

      I previously mentioned this in CRM-17918 because it seemed related but Jitendra couldn't reproduce it. Anyway I currently have a configuration that can reproduce this error on the 4.7.2 Drupal demo (not sure how long it'll be there) at http://dmaster.demo.civicrm.org/civicrm/contact/view?reset=1&cid=202
      (go to "demo" contact, go to the Custom2 tab and try to sort any column of the DataTable)

      Steps to reproduce:

      1. Create a custom field group "Custom1" for Individual contact type and set to allow multiple records and use default of "tab with table"
      2. Create two alphanumeric text fields "Field1" and "Field2" and two date fields "Date1" and "Date2" in dd/mm/yyyy format in Custom1
      3. Create another custom field group, Custom2, with same configuration and fields as for Custom1
      4. View any contact
      5. Enter two records for this contact in Custom1 with data in all four fields
      6. Enter two records for the same contact in Custom2 with data in all four fields
      7. In the Custom2 tab click on a column heading to attempt to sort it - this should give an error: "DataTables warning: table id=records-10 - Invalid JSON response. For more information about this error, please see http://datatables.net/tn/1" (may need to refresh the contact and go to Custom2 tab first)

        Attachments

          Activity

            People

            • Assignee:
              jlacey Joseph Lacey
              Reporter:
              andrewpthompson Andrew Thompson
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: