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

[REF] dev/core#2790 move buildForm to pdfTrait #21297

Merged
merged 1 commit into from
Aug 30, 2021

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

[REF] dev/core#2790 move buildForm to pdfTrait

Before

Function is on static class that is under deprecation

After

Function moved to a trait

Technical Details

This moves the buildForm function over the pdfTrait

I note that some of the functions have

I wonder if they all should - I suspect so

Comments

@civibot
Copy link

civibot bot commented Aug 28, 2021

(Standard links)

@civibot civibot bot added the master label Aug 28, 2021
@@ -21,6 +21,8 @@
*/
class CRM_Member_Form_Task_PDFLetter extends CRM_Member_Form_Task {

use CRM_Contact_Form_Task_PDFTrait;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The others already have this trait

@colemanw
Copy link
Member

@eileenmcnaughton see style check

This moves the buildForm function over the pdfTrait

I note that some of the functions have

I wonder if they all should  - I suspect so
@eileenmcnaughton
Copy link
Contributor Author

thanks @colemanw - fixed

@eileenmcnaughton
Copy link
Contributor Author

@demeritcowboy this will make the activity one go stale again :-( - but whichever order they are merged in I'll just rebase

@demeritcowboy
Copy link
Contributor

I can take a look at this today.

@eileenmcnaughton
Copy link
Contributor Author

thanks @demeritcowboy

@demeritcowboy
Copy link
Contributor

Looks good.

I note that some of the functions have

I wonder if they all should - I suspect so

I'm not sure what this is referring to (maybe suppressForm?) but I assume there's more PRs coming.

@demeritcowboy demeritcowboy merged commit d5524df into civicrm:master Aug 30, 2021
* @var CRM_Core_Form $form
* @throws \CRM_Core_Exception
*/
public static function buildQuickForm(&$form) {
CRM_Core_Error::deprecatedFunctionWarning('no supported alternative for non-core code');
Copy link
Contributor

Choose a reason for hiding this comment

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

Oops I merged a little too soon. The thank-you letters hit this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

opps - well we can fix that

@@ -82,7 +84,7 @@ public function buildQuickForm() {

// Contribute PDF tasks allow you to email as well, so we need to add email address to those forms
$this->add('select', 'from_email_address', ts('From Email Address'), $this->_fromEmails, TRUE);
CRM_Core_Form_Task_PDFLetterCommon::buildQuickForm($this);
$this->addPDFElementsToForm();
Copy link
Contributor

Choose a reason for hiding this comment

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

Line 83: CRM_Contact_Form_Task_PDFLetterCommon::buildQuickForm does exactly the same thing as line 85 CRM_Core_Form_Task_PDFLetterCommon::buildQuickForm(), so that's why it gives the deprecation notice.

@eileenmcnaughton eileenmcnaughton deleted the pdftrait branch August 30, 2021 22:59
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