Error: Call to a member function toLink() on array in Drupal\bynder_sns\EventSubscriber\NotificationSubscriber->onNotification() (line 120 of /var/www/html/docroot/modules/contrib/bynder/modules/bynder_sns/src/EventSubscriber/NotificationSubscriber.php)

Created on 27 February 2023, over 1 year ago

Problem/Motivation

Bynder SNS updates media file successfuly, then notice() method trying to extract link from media, but we load array of media items:

Error: Call to a member function toLink() on array in Drupal\bynder_sns\EventSubscriber\NotificationSubscriber->onNotification() (line 120 of /var/www/html/docroot/modules/contrib/bynder/modules/bynder_sns/src/EventSubscriber/NotificationSubscriber.php)
#0 [internal function]: Drupal\bynder_sns\EventSubscriber\NotificationSubscriber->onNotification()
#1 /var/www/html/docroot/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(142): call_user_func()
#2 /var/www/html/docroot/modules/contrib/amazon_sns/src/Event/MessageEventDispatcher.php(60): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()
#3 /var/www/html/docroot/modules/contrib/amazon_sns/src/Controller/NotificationController.php(89): Drupal\amazon_sns\Event\MessageEventDispatcher->dispatch()
#4 [internal function]: Drupal\amazon_sns\Controller\NotificationController->receive()
#5 /var/www/html/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
#6 /var/www/html/docroot/core/lib/Drupal/Core/Render/Renderer.php(564): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#7 /var/www/html/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext()
#8 /var/www/html/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
#9 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(169): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#10 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#11 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle()
#12 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#13 /var/www/html/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#14 /var/www/html/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
#15 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle()
#16 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#17 /var/www/html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#18 /var/www/html/docroot/core/lib/Drupal/Core/DrupalKernel.php(709): Stack\StackedHttpKernel->handle()
#19 /var/www/html/docroot/index.php(19): Drupal\Core\DrupalKernel->handle()
#20 {main}

Steps to reproduce

It's hard to debug with xdebug, because we need to run it with Amazon SNS request, I don't have testing environment locally for it. But it should be enough to update Bynder item and receive Amazon SNS request.

Proposed resolution

We should get one media item with reset().

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Needs review

Version

4.1

Component

Code

Created by

πŸ‡¦πŸ‡²Armenia levmyshkin Yerevan, Armenia

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

Comments & Activities

Production build 0.69.0 2024