Call to a member function getEmail() on null. Cron broken.

Created on 30 October 2023, 8 months ago
Updated 17 November 2023, 7 months ago

Problem/Motivation

Got the error on cron run:
Error: Call to a member function getEmail() on null in Drupal\commerce_ticketing\Mail\TicketReceiptMail->send() (line 129 of /var/www/html/web/modules/contrib/commerce_ticketing/src/Mail/TicketReceiptMail.php).

Steps to reproduce

1. Create order with tickets
2. Delete it
3. Run cron and get the error

Proposed resolution

Add additional check for order existence in TicketReceiptMail::send method.

API changes

Data model changes

🐛 Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

🇬🇪Georgia maximkashuba Batumi

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @maximkashuba
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update 8 months ago
    18 pass
  • @maximkashuba opened merge request.
  • Assigned to abhishek_virasat
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update 8 months ago
    18 pass
  • Issue was unassigned.
  • Status changed to Needs review 8 months ago
  • 🇮🇳India abhishek_virasat

    @pcambra, i have fixed the issue, please kindly review the MR

  • 🇦🇺Australia interlated

    I applied this patch. Fixes the initial problem. I still got

    Error: Call to a member function getOrderNumber() on null in Drupal\commerce_ticketing\Mail\TicketReceiptMail->send() (line 144 of /web/modules/patched/commerce_ticketing/src/Mail/TicketReceiptMail.php)
    #0 /web/modules/patched/commerce_ticketing/src/Plugin/QueueWorker/CommerceTicketingSendTicketReceiptWorker.php(78): Drupal\commerce_ticketing\Mail\TicketReceiptMail->send()
    #1 /web/core/lib/Drupal/Core/Cron.php(183): Drupal\commerce_ticketing\Plugin\QueueWorker\CommerceTicketingSendTicketReceiptWorker->processItem()
    #2 /web/core/lib/Drupal/Core/Cron.php(139): Drupal\Core\Cron->processQueues()
    #3 /web/core/lib/Drupal/Core/ProxyClass/Cron.php(75): Drupal\Core\Cron->run()
    #4 /vendor/drush/drush/src/Drupal/Commands/core/DrupalCommands.php(69): Drupal\Core\ProxyClass\Cron->run()
    #5 [internal function]: Drush\Drupal\Commands\core\DrupalCommands->cron()
    #6 /vendor/consolidation/annotated-command/src/CommandProcessor.php(276): call_user_func_array()
    #7 /vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback()
    #8 /vendor/consolidation/annotated-command/src/CommandProcessor.php(175): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter()
    #9 /vendor/consolidation/annotated-command/src/AnnotatedCommand.php(387): Consolidation\AnnotatedCommand\CommandProcessor->process()
    #10 /vendor/symfony/console/Command/Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute()
    #11 /vendor/symfony/console/Application.php(1039): Symfony\Component\Console\Command\Command->run()
    #12 /vendor/symfony/console/Application.php(275): Symfony\Component\Console\Application->doRunCommand()
    #13 /vendor/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
    #14 /vendor/drush/drush/src/Runtime/Runtime.php(124): Symfony\Component\Console\Application->run()
    #15 /vendor/drush/drush/src/Runtime/Runtime.php(51): Drush\Runtime\Runtime->doRun()
    #16 /vendor/drush/drush/drush.php(79): Drush\Runtime\Runtime->run()
    #17 /vendor/drush/drush/drush(4): require('...')

Production build 0.69.0 2024