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

[ready for core team to review] CRM-20614 Don't download export file until asked #10393

Merged
merged 2 commits into from
Dec 21, 2017

Conversation

pradpnayak
Copy link
Contributor


Copy link
Member

@colemanw colemanw left a comment

Choose a reason for hiding this comment

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

Overall this looks safe, but recommend class variables be explicitly defined.

@@ -594,6 +596,7 @@ public static function exportFinancialBatch($batchIds, $exportFormat) {
else {
CRM_Core_Error::fatal("Could not locate exporter: $exporterClass");
}
$exporter->_isDownloadFile = $downloadFile;
Copy link
Member

Choose a reason for hiding this comment

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

I don't see the property $_isDownloadFile declared in that class.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@colemanw I have pushed the changes. Can you please review?

Copy link
Member

Choose a reason for hiding this comment

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

Have you tried it? I think this will give a fatal error trying to set a protected property.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oops sorry, Extension had a over-ridden copy of this file therefore i didn't get the error while testing. I have updated the changes now.

@pradpnayak
Copy link
Contributor Author

@civicrm-builder test this please

@monishdeb
Copy link
Member

monishdeb commented Jul 4, 2017

@colemanw I have tested the patch and it works fine now.

@monishdeb monishdeb changed the title CRM-20614 Don't download export file until asked [ready for core team to merge] CRM-20614 Don't download export file until asked Jul 4, 2017
@monishdeb monishdeb changed the title [ready for core team to merge] CRM-20614 Don't download export file until asked [ready for core team to review] CRM-20614 Don't download export file until asked Jul 4, 2017
----------------------------------------
* CRM-20614: Donot Download Export file for Financial Batch
  https://issues.civicrm.org/jira/browse/CRM-20614
----------------------------------------
* CRM-20614: Donot Download Export file for Financial Batch
  https://issues.civicrm.org/jira/browse/CRM-20614

--fixed fatal error
@pradpnayak
Copy link
Contributor Author

@colemanw i have rebased the PR. Can you please review?

*/
public static function exportFinancialBatch($batchIds, $exportFormat) {
public static function exportFinancialBatch($batchIds, $exportFormat, $downloadFile) {
Copy link
Member

Choose a reason for hiding this comment

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

Add a default value to downloadFile to keep compatibility with older versions?

Copy link
Member

@monishdeb monishdeb Nov 29, 2017

Choose a reason for hiding this comment

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

@mlutfy exportFinancialBatch(...) is used only in one place as I grep`ed in codebase

Monishs-MacBook-Pro:civicrm monish$ grep -irn "exportFinancialBatch" CRM api/
CRM/Batch/BAO/Batch.php:45:   * Not sure this is the best way to do this. Depends on how exportFinancialBatch() below gets called.
CRM/Batch/BAO/Batch.php:600:  public static function exportFinancialBatch($batchIds, $exportFormat, $downloadFile) {
CRM/Financial/Form/Export.php:178:    CRM_Batch_BAO_Batch::exportFinancialBatch($batchIds, $this->_exportFormat, $this->_downloadFile);

So I think its not required to provide a default value. What do you say?

@monishdeb
Copy link
Member

@colemanw @mlutfy is there anything left to fix, to get this PR merged?

@colemanw
Copy link
Member

@colemanw colemanw merged commit 3d023ea into civicrm:master Dec 21, 2017
sluc23 pushed a commit to ixiam/civicrm-core that referenced this pull request Jan 10, 2018
[ready for core team to review] CRM-20614 Don't download export file until asked
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.

5 participants