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

CRM-21391 Convert Member to use core Task class #11762

Merged
merged 1 commit into from
Mar 12, 2018

Conversation

mattwire
Copy link
Contributor

@mattwire mattwire commented Mar 5, 2018

Overview

Refactor member task form to use base class

Before

localhost_8000_civicrm_member_search__qf_search_display true qfkey 7dd0602c2407d318bfea3325a42d4e13_1263 1

After

localhost_8000_civicrm_member_search__qf_search_display true qfkey 7dd0602c2407d318bfea3325a42d4e13_1263

Technical Details

details in #11240

Comments

This is a commit from #11240

In terms of review check that the code was a positive improvement and tested a couple of actions as well as checking the same number of actions were present


$form->assign('taskName', $memberTasks[$form->_task]);
$tasks = CRM_Member_Task::permissionedTaskTitles(CRM_Core_Permission::getPermission());
if (!array_key_exists($form->_task, $tasks)) {
CRM_Core_Error::statusBounce(ts('You do not have permission to access this page.'));
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel a little nervous about this standardisation - does this bounce happen BEFORE or AFTER hooks get to 'add their say'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@eileenmcnaughton This has been standardised across all tasks. Previously I think some did this, some did not. It is on the form layer AFTER hooks have run (the searchTasks hook gets run via permissionedTaskTitles in this case so you are only likely to get here with an invalid task ID if you've manipulated a URL or done something else weird - it was then somewhat undefined as to what would happen, a task might load or you might get a fatal.

@eileenmcnaughton
Copy link
Contributor

I UI tested this & it seems good. Code looks good & has been previously agreed as an improvement. Merging

@eileenmcnaughton eileenmcnaughton merged commit 0a40daf into civicrm:master Mar 12, 2018
@mattwire mattwire deleted the CRM-21391_member_task branch September 25, 2018 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants