Error on cron run

Created on 28 March 2023, over 1 year ago
Updated 20 April 2023, over 1 year ago

Problem/Motivation

I can see the following error on Cron execution:
Error: Call to a member function getEmail() on null in Drupal\commerce_ticketing\Mail\TicketReceiptMail->send()

I can resend the commerce ticket receipt manually without any error.

Drupal Version: 9.5.7
PHP: 8.1.17

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

2.0

Component

Miscellaneous

Created by

🇦🇹Austria xurubo93

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

Comments & Activities

  • Issue created by @xurubo93
  • 🇦🇹Austria xurubo93

    I first suspected that this issue https://www.drupal.org/project/commerce_ticketing/issues/3192100 is still the cause for this error. I put some logger code into the the Class TicketReceiptMail.php and the output shows me ticket numbers which are not present anymore. The orders have been deleted already

          /* @var $order \Drupal\commerce_order\Entity\Order*/
          if ($order = $ticket->getOrder()) {
            \Drupal::logger('commerce_ticketing')->info('Order id no' .$order->id(). ' could be loaded. Underlying Ticket No: '. $ticket->getTicketNumber());
          } else {
            \Drupal::logger('commerce_ticketing')->error('Order class could not be loaded. ' . 'Ticket Id: ' .$ticket->id() . ' Ticket-No: ' .$ticket->getTicketNumber());
          }
    

    It was caused by the fact that I exported my local dev database to production and there has been some leftovers in the queue-table. I truncated this table and the error is gone for now.

  • First commit to issue fork.
  • @_pratik_ opened merge request.
  • I was seeing the same error. Clearing the queue table as suggested in #2 seems to have fixed the problem.

Production build 0.71.5 2024