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

Add API to get session messages

    Details

    • Type: Improvement
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Incomplete
    • Affects Version/s: 4.7.13
    • Fix Version/s: None
    • Component/s: CiviCRM API, Core CiviCRM
    • Labels:
      None
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      Developer Doc
    • Funding Source:
      Needs Funding

      Description

      Current situation:

      CiviCRM (or an extension or module) can generate session status messages with, for example, CRM_Core_Session::setStatus(). These messages are displayed in the browser on the next page load of a URL under /civicrm.

      However, these messages may also be generated by processes which don't trigger a new page load. For example, an extension may implement hook_civicrm_post() and generate a status message upon the modification of a contact. If the contact is modified with an AJAX call such as CRM.api3(), the status message won't be displayed until later, at which point it may not even be relevant to the user.

      TODO:
      Provide an API to consume status messages in the current session, so that they can be displayed by AJAX processes.

      For the future / out of scope for this ticket:
      Add functionality to CRM.api3() to automatically consume and display status messages. Also consider how status messages can be handled for REST api calls and other use cases not involving a page load under /civicrm.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              allenshaw Allen Shaw
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: