User warning: Invalid placeholder (langcode) with string: "Your booking is confirmed" in Drupal\Component\Render\FormattableMarkup::placeholderFormat() (line 245 of /var/www/html/web/core/lib/Drupal/Component/Render/FormattableMarkup.php)

Created on 8 July 2023, 12 months ago
Updated 29 December 2023, 6 months ago

Many thanks for this great calendar module.

It's been easy to setup and looks very good. However, whenever I make a booking I get the error message below?

Error message
User warning: Invalid placeholder (langcode) with string: "Your booking is confirmed" in Drupal\Component\Render\FormattableMarkup::placeholderFormat() (line 245 of core/lib/Drupal/Component/Render/FormattableMarkup.php).
Drupal\Component\Render\FormattableMarkup::placeholderFormat('Your booking is confirmed', Array) (Line: 195)
Drupal\Core\StringTranslation\TranslatableMarkup->render() (Line: 15)
Drupal\Core\StringTranslation\TranslatableMarkup->__toString() (Line: 22)
Drupal\Component\Render\PlainTextOutput::renderFromHtml(Object) (Line: 305)
Drupal\Core\Mail\MailManager->doMail('bookable_calendar', 'bookable_calendar_notification', 'mike@example.com', 'en', Array, NULL, 1) (Line: 180)
Drupal\Core\Mail\MailManager->Drupal\Core\Mail\{closure}() (Line: 583)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 181)
Drupal\Core\Mail\MailManager->mail('bookable_calendar', 'bookable_calendar_notification', 'mike@example.com', 'en', Array, NULL, 1) (Line: 126)
Drupal\bookable_calendar\Notification->sendNotification(Object) (Line: 283)
Drupal\bookable_calendar\Entity\BookingContact->postSave(Object, ) (Line: 563)
Drupal\Core\Entity\EntityStorageBase->doPostSave(Object, ) (Line: 781)
Drupal\Core\Entity\ContentEntityStorageBase->doPostSave(Object, ) (Line: 489)
Drupal\Core\Entity\EntityStorageBase->save(Object) (Line: 806)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->save(Object) (Line: 339)
Drupal\Core\Entity\EntityBase->save() (Line: 37)
Drupal\bookable_calendar\Form\BookingContactForm->save(Array, Object)
call_user_func_array(Array, Array) (Line: 114)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 52)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 597)
Drupal\Core\Form\FormBuilder->processForm('booking_contact_add_form', Array, Object) (Line: 325)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 583)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 166)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 74)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

I've just upgraded to Drupal core 10.1.1 with PHP 8.1.16 and I'm still getting the same error message.

πŸ› Bug report
Status

Fixed

Version

2.2

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom mikee

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

Comments & Activities

  • Issue created by @mikee
  • πŸ‡ΊπŸ‡ΈUnited States josh.fabean

    I see this, I'll see if I can get something figured out here shortly.

  • Assigned to josh.fabean
  • πŸ‡ΊπŸ‡ΈUnited States josh.fabean
  • Status changed to Closed: cannot reproduce 11 months ago
  • πŸ‡ΊπŸ‡ΈUnited States josh.fabean

    I've poked around with this and cannot recreate it. That is the default subject in the email that goes out to people when they claim a booking. On a fresh install with nothing else installed, I do not get that error. I then turned on the language module in Drupal since it's a translation issue, created a new booking and still no error.

    I do see some changes that could be made around this email notification code but without being able to create the actual issue it's hard to know if they is still an issue.

    Do you have more info on your site's setup that would help recreate this issue?

  • πŸ‡¬πŸ‡§United Kingdom mikee

    Many thanks. In that case, I will create a fresh site on the same platform with the same modules (as the site with the issue) and see if that gets rid of the problem? FYI, the site where the issue exists was originally a Drupal 7 site that I upgraded to Drupal 10. I'm now wondering whether that might have somehow contributed to the problem? I'll get back to you shortly and let you know what happens. Thanks again.

  • @mikee did you have a solution to this in the end? I'm having exactly the same issue. Have tried reinstalling the module.

  • Status changed to Active 10 months ago
  • πŸ‡ΊπŸ‡ΈUnited States josh.fabean

    I can try creating the issue again. If you want to reach out to me on drupal slack and give me a database or something to better recreate the error, that could help.

  • πŸ‡ΊπŸ‡ΈUnited States josh.fabean

    Pushed up a fixed to dev branch.

  • Issue was unassigned.
  • Status changed to Needs review 9 months ago
  • πŸ‡ΊπŸ‡ΈUnited States josh.fabean
  • πŸ‡ΊπŸ‡ΈUnited States josh.fabean
  • Status changed to Fixed 6 months ago
  • πŸ‡ΊπŸ‡ΈUnited States josh.fabean
Production build 0.69.0 2024