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

Contact Dashboard does not handle Ajax API return code 403 well

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.5.4
    • Fix Version/s: 4.5.5
    • Component/s: Core CiviCRM
    • Labels:
      None
    • Documentation Required?:
      None

      Description

      If a user gets access to the "Contact Dashboard" but does not have access to see all contacts (only My Contact), the Contact Dashboard throws a dialog box error:

      DataTables warning: table id=DataTables_Table_0 - Ajax error. For more information about this error, please see http://datatables.net/tn/7

      This is caused by the Ajax API throwing a 403 when accessing the "Relationships" (/civicrm/ajax/contactrelationships). The error should be handled instead of passing it to DataTables.

      According to DataTables page:
      If you are willing to accept the error (for example if you cannot alter the backend system to fix the error), but don't want your end users to see the alert() message, you can change DataTables' error reporting mechanism to throw a Javascript error to the browser's console, rather than alerting it. This can be done using:

      Javascript: $.fn.dataTable.ext.errMode = 'throw';

      I don't know whether the API should throw a 403 or a 200 with a JSON error.

        Attachments

          Activity

            People

            • Assignee:
              dgg David Greenberg
              Reporter:
              guruevi Evi Vanoost
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: