-
-
Notifications
You must be signed in to change notification settings - Fork 824
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
Remove unused parameter, immediately overwritten parameter #17131
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,18 +22,21 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form { | |
|
||
/** | ||
* Maximum profile fields that will be displayed. | ||
* | ||
* @var int | ||
*/ | ||
protected $_rowCount = 1; | ||
|
||
/** | ||
* Batch id. | ||
* | ||
* @var int | ||
*/ | ||
protected $_batchId; | ||
|
||
/** | ||
* Batch information. | ||
* | ||
* @var array | ||
*/ | ||
protected $_batchInfo = []; | ||
|
@@ -52,22 +55,26 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form { | |
|
||
/** | ||
* When not to reset sort_name. | ||
* | ||
* @var bool | ||
*/ | ||
protected $_preserveDefault = TRUE; | ||
|
||
/** | ||
* Contact fields. | ||
* | ||
* @var array | ||
*/ | ||
protected $_contactFields = []; | ||
|
||
/** | ||
* Fields array of fields in the batch profile. | ||
* | ||
* (based on the uf_field table data) | ||
* (this can't be protected as it is passed into the CRM_Contact_Form_Task_Batch::parseStreetAddress function | ||
* (although a future refactoring might hopefully change that so it uses the api & the function is not | ||
* required | ||
* | ||
* @var array | ||
*/ | ||
public $_fields = []; | ||
|
@@ -84,6 +91,8 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form { | |
|
||
/** | ||
* Build all the data structures needed to build the form. | ||
* | ||
* @throws \CRM_Core_Exception | ||
*/ | ||
public function preProcess() { | ||
$this->_batchId = CRM_Utils_Request::retrieve('id', 'Positive', $this, TRUE); | ||
|
@@ -120,6 +129,8 @@ public function setBatchID($id) { | |
|
||
/** | ||
* Build the form object. | ||
* | ||
* @throws \CRM_Core_Exception | ||
*/ | ||
public function buildQuickForm() { | ||
if (!$this->_profileId) { | ||
|
@@ -132,15 +143,14 @@ public function buildQuickForm() { | |
// get the profile information | ||
if ($this->_batchInfo['type_id'] == $batchTypes['Contribution']) { | ||
CRM_Utils_System::setTitle(ts('Batch Data Entry for Contributions')); | ||
$customFields = CRM_Core_BAO_CustomField::getFields('Contribution'); | ||
} | ||
elseif ($this->_batchInfo['type_id'] == $batchTypes['Membership']) { | ||
CRM_Utils_System::setTitle(ts('Batch Data Entry for Memberships')); | ||
} | ||
elseif ($this->_batchInfo['type_id'] == $batchTypes['Pledge Payment']) { | ||
CRM_Utils_System::setTitle(ts('Batch Data Entry for Pledge Payments')); | ||
} | ||
$this->_fields = []; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see next line... |
||
|
||
$this->_fields = CRM_Core_BAO_UFGroup::getFields($this->_profileId, FALSE, CRM_Core_Action::VIEW); | ||
|
||
// remove file type field and then limit fields | ||
|
@@ -367,6 +377,8 @@ public function cancelAction() { | |
|
||
/** | ||
* Set default values for the form. | ||
* | ||
* @throws \CRM_Core_Exception | ||
*/ | ||
public function setDefaultValues() { | ||
if (empty($this->_fields)) { | ||
|
@@ -402,6 +414,9 @@ public function setDefaultValues() { | |
|
||
/** | ||
* Process the form after the input has been submitted and validated. | ||
* | ||
* @throws \CRM_Core_Exception | ||
* @throws \CiviCRM_API3_Exception | ||
*/ | ||
public function postProcess() { | ||
$params = $this->controller->exportValues($this->_name); | ||
|
@@ -439,6 +454,9 @@ public function postProcess() { | |
* Associated array of submitted values. | ||
* | ||
* @return bool | ||
* | ||
* @throws \CRM_Core_Exception | ||
* @throws \CiviCRM_API3_Exception | ||
*/ | ||
private function processContribution(&$params) { | ||
|
||
|
@@ -928,6 +946,9 @@ public function testProcessMembership($params) { | |
* @param array $params | ||
* | ||
* @return bool | ||
* | ||
* @throws \CRM_Core_Exception | ||
* @throws \CiviCRM_API3_Exception | ||
*/ | ||
public function testProcessContribution($params) { | ||
return $this->processContribution($params); | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, to my eye, the handling of
$customFields
inprocessMembership()
looks fairly similar (i.e. no obvious/meaningful reads, only obvious writes). Not saying that needs to be addressed at the same time - but just in case you're interested.Maybe after the
r-test
build finishes, then we just to do 5-minr-run
on the autobuild site to confirm that the custom-fields still render+save on the batch-entry screen.