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

Fully deprecate getTokenDetails #22483

Merged
merged 1 commit into from
Mar 9, 2022
Merged

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

#22482 (also in this PR) removes the last core call to getTokenDetails outside of legacy Mailing BAO methods - now we can add deprecation notices & stop testing it

Before

Only deprecation annotations

After

Noisy deprecation

Technical Details

Comments

@civibot civibot bot added the master label Jan 12, 2022
@civibot
Copy link

civibot bot commented Jan 12, 2022

(Standard links)

@eileenmcnaughton
Copy link
Contributor Author

Hmm - looks like flexmailer is going through BAO classes functions I didn't think it did

CRM_Mailing_MailingSystemTest::testBasicHeaders
Failure in api call for job process_mailing: Deprecated function CRM_Utils_Token::getTokenDetails, use If you hit this in mailing code you should use flexmailer - otherwise use the token processor.
#0 [internal function]: PHPUnit\Util\ErrorHandler->__invoke(16384, 'Deprecated func...', '/home/jenkins/b...', 1044)
#1 /home/jenkins/bknix-dfl/build/core-22483-5cy83/web/sites/all/modules/civicrm/CRM/Core/Error.php(1044): trigger_error('Deprecated func...', 16384)
#2 /home/jenkins/bknix-dfl/build/core-22483-5cy83/web/sites/all/modules/civicrm/CRM/Utils/Token.php(1181): CRM_Core_Error::deprecatedFunctionWarning('If you hit this...')
#3 /home/jenkins/bknix-dfl/build/core-22483-5cy83/web/sites/all/modules/civicrm/CRM/Mailing/BAO/MailingJob.php(599): CRM_Utils_Token::getTokenDetails(Array, Array, true, true, NULL, Array, 'CRM_Mailing_BAO...', '22')
#4 /home/jenkins/bknix-dfl/build/core-22483-5cy83/web/sites/all/modules/civicrm/CRM/Mailing/BAO/MailingJob.php(546): CRM_Mailing_BAO_MailingJob->deliverGroup(Array, Object(CRM_Mailing_BAO_Mailing), Object(CRM_Utils_Mail_FilteredPearMailer), '2022-01-12 05:0...', Array)
#5 /home/jenkins/bknix-dfl/build/core-22483-5cy83/web/sites/all/modules/civicrm/ext/flexmailer/src/Listener/Abdicator.php(70): CRM_Mailing_BAO_MailingJob->deliver(Object(CRM_Utils_Mail_FilteredPearMailer), NULL)
#6 [internal function]: Civi\FlexMailer\Listener\Abdicator->onRun(Object(Civi\FlexMailer\Event\RunEvent), 'civi.flexmailer...', Object(Civi\Core\CiviEventDispatcher))
#7 /home/jenkins/bknix-dfl/build/core-22483-5cy83/web/sites/all/modules/civicrm/Civi/Core/Event/ServiceListener.php(53): call_user_func_array(Array, Array)
#8 /home/jenkins/bknix-dfl/build/core-22483-5cy83/web/sites/all/modules/civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php(214): Civi\Core\Event\ServiceListener->__invoke(Object(Civi\FlexMailer\Event\RunEvent), 'civi.flexmailer...', Object(Civi\Core\CiviEventDispatcher))
#9 /home/jenkins/bknix-dfl/build/core-22483-5cy83/web/sites/all/modules/civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php(44): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'civi.flexmailer...', Object(Civi\FlexMailer\Event\RunEvent))
#10 /home/jenkins/bknix-dfl/build/core-22483-5cy83/web/sites/all/modules/civicrm/Civi/Core/CiviEventDispatcher.php(198): Symfony\Component\EventDispatcher\EventDispatcher->dispatch('civi.flexmailer...', Object(Civi\FlexMailer\Event\RunEvent))

@eileenmcnaughton
Copy link
Contributor Author

CRM_Mailing_MailingSystemTest.testBasicHeaders

@seamuslee001
Copy link
Contributor

@eileenmcnaughton The test is configured to go through the legacy stuff deliberately see

Civi::settings()->add(['flexmailer_traditional' => 'bao']);
and cfc8e5b#diff-e69658a8661c3d88a794b9346a61697d9549d5c277041c09861331715566b0d9R45

@eileenmcnaughton
Copy link
Contributor Author

@seamuslee001 ah thanks - so part of deprecating is removing the test now

This is only called in legacy mailing code now so stop testing it & deprecate it
@eileenmcnaughton
Copy link
Contributor Author

@seamuslee001 OK to merge - I removed a bunch of tests but kept 1 with some magic to cause the notices to not derail it

@mattwire mattwire merged commit f229b2f into civicrm:master Mar 9, 2022
@eileenmcnaughton eileenmcnaughton deleted the token1 branch March 9, 2022 22:58
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