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] Move id fetching to the classes #21075

Merged
merged 1 commit into from
Aug 14, 2021

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

[Ref] Move id fetching to the classes

Before

Shared class tries to retrieve contributionIDs, caseId from properties - it shouldn't need to know about them

After

For contribution it's moved to the contribution class - but case leaves me with questions - so I though I'd open this & ask Dave - @demeritcowboy - do you think the handling for _caseId rightly belongs on CRM_Activity_Form_Task_Email

Technical Details

Comments

@civibot
Copy link

civibot bot commented Aug 10, 2021

(Standard links)

@civibot civibot bot added the master label Aug 10, 2021
*
* This raises questions -
* 1) can it be something other than an integer
* 2) is the right class for this the activity email task?
Copy link
Contributor

Choose a reason for hiding this comment

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

For 1, it used to be - see https://lab.civicrm.org/dev/core/-/issues/2463

For 2, I don't have a thoughtful answer at the moment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@demeritcowboy so for clarity we could do

return $this->_caseId ? (int) $this->_caseId : NULL;

Copy link
Contributor Author

@eileenmcnaughton eileenmcnaughton Aug 10, 2021

Choose a reason for hiding this comment

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

@demeritcowboy for 2 - maybe I can copy the function onto that class & in this class have

 protected function getCaseID() {
   if ($this->_caseId) {
    CRM_Core_Error::deprecatedWarning('case Id should only be present for ctivity emails - how did you get here');
    return (int) $this->_caseId;
  } 
 return NULL
  }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've updated the PR to how I think it should look (as long as I'm right about case id being an activity only thing)

Copy link
Contributor

@demeritcowboy demeritcowboy Aug 10, 2021

Choose a reason for hiding this comment

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

I'm still thinking, but as a practical matter the new deprecation comes up if you just send an email from Manage Case (i.e. from within the roles section), so it's obviously currently going thru there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah I thought that was the activity class - will track it down

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@demeritcowboy I toned it down to still keeping the case stuff on the Trait

Copy link
Contributor

Choose a reason for hiding this comment

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

For the contribution one I get some warnings/notices, but it's pre-existing (e.g. find contributions - actions - send email). Looks good.

@eileenmcnaughton eileenmcnaughton force-pushed the email3 branch 2 times, most recently from c53bd0e to db4d540 Compare August 13, 2021 21:15
@demeritcowboy demeritcowboy merged commit 16801cc into civicrm:master Aug 14, 2021
@eileenmcnaughton eileenmcnaughton deleted the email3 branch August 14, 2021 21:51
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.

2 participants