Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP View test event registrations on contact summary (event tab) #12421

Closed

Conversation

mattwire
Copy link
Contributor

@mattwire mattwire commented Jul 5, 2018

Overview

REQUIRES CONCEPT REVIEW AND APPROVAL

Show test registrations on event tab in contact summary. (Related to #12385).

Before

Test registrations not shown.

After

Test registrations shown.

Technical Details

Most of the contact tabs use an implementation of CRM_Core_Form_Search to retrieve/show results. In this case CRM_Event_Form_Search.

  1. In order to make sure results are always up to date and not cached the force=1 parameter is automatically passed to the search form class.
  2. However, this force=1 parameter is also used to assume that we don't want test transactions.
  3. When CRM_Event_Form_Search is triggered from the contact tab the context parameter is not set and defaults to "search" which is used in quite a few other places (where we probably don't want test transactions?).
  4. The correct context, looking at the switch($context) seems to be 'participant' so we set that using urlPath.
  5. We can then test if context = participant, and show test transactions if that is the case.

@pradpnayak Could you comment? Do you think there would be a better way to do this? It will need to be done for other entities (eg. Pledge, Case).

@civibot
Copy link

civibot bot commented Jul 5, 2018

(Standard links)

@mattwire
Copy link
Contributor Author

@colemanw I don't know if this is something you're familiar with at all, given your work on the contact summary/tabs?
If there's no interest I'll close it but I thought it would be nice to improve display of test entities further.

@colemanw
Copy link
Member

You got me at number 2: "this force=1 parameter is also used to assume that we don't want test transactions". WHAT?? What did we all learn in school about "assume makes an ass of u and me"
I'm really looking forward to the day where we get rid these huge monster functions that do slightly different things based on magic assumptions about context.

Meanwhile, I agree with the concept; there's hardly any point of creating test registrations if they can't be seen.

$context = CRM_Utils_Request::retrieve('context',
'String', $this, FALSE, 'search'
);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In what scenario would the incoming URL path not be civicrm/contact/view/participant?

@mattwire
Copy link
Contributor Author

@mattwire mattwire closed this Dec 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants