There is a website encountered error issue thrown when authored user is deleted making the content anonymous

Steps to Reproduce:

  • Create a event series with an xyz user.
  • Cancel that xyz user account, Select the option Delete the user and set the content to Anonymous option.
  • Now, go back to event series page and edit/clone the event that is created by that xyz user.

Here is the issue:

Error: Call to a member function getDisplayName() on null in Drupal\recurring_events\Form\EventSeriesForm->buildForm() (line 292 of /var/www/docroot/modules/contrib/recurring_events/src/Form/EventSeriesForm.php)

#0 [internal function]: Drupal\recurring_events\Form\EventSeriesForm->buildForm(Array, Object(Drupal\Core\Form\FormState))
#1 /var/www/docroot/core/lib/Drupal/Core/Form/FormBuilder.php(532): call_user_func_array(Array, Array)
#2 /var/www/docroot/core/lib/Drupal/Core/Form/FormBuilder.php(278): Drupal\Core\Form\FormBuilder->retrieveForm('eventseries_vir...', Object(Drupal\Core\Form\FormState))
#3 /var/www/docroot/core/lib/Drupal/Core/Controller/FormController.php(91): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\recurring_events\Form\EventSeriesForm), Object(Drupal\Core\Form\FormState))
#4 [internal function]: Drupal\Core\Controller\FormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch))
#5 /var/www/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#6 /var/www/docroot/core/lib/Drupal/Core/Render/Renderer.php(573): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#7 /var/www/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#8 /var/www/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#9 /var/www/vendor/symfony/http-kernel/HttpKernel.php(151): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#10 /var/www/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#11 /var/www/docroot/modules/contrib/simple_oauth/src/HttpMiddleware/BasicAuthSwap.php(67): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#12 /var/www/docroot/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Drupal\simple_oauth\HttpMiddleware\BasicAuthSwap->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#13 /var/www/docroot/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#14 /var/www/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#15 /var/www/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#16 /var/www/docroot/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#17 /var/www/docroot/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#18 /var/www/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#19 /var/www/docroot/core/lib/Drupal/Core/DrupalKernel.php(708): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#20 /var/www/docroot/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#21 {main}

.

Comments

kbk1992 created an issue. See original summary.

bharath-kondeti’s picture

StatusFileSize
new1.08 KB

Fix for the issue. Please verify

bharath-kondeti’s picture

Assigned: Unassigned » bharath-kondeti
Status: Active » Needs review
owenbush’s picture

Thanks for raising the issue. I'll try and take a look this week.

  • owenbush committed b788ac5 on 2.0.x authored by kbk1992
    Issue #3229674 by kbk1992, owenbush: Event edit and clone issue if the...

  • owenbush committed 5317721 on 8.x-1.x authored by kbk1992
    Issue #3229674 by kbk1992, owenbush: Event edit and clone issue if the...
owenbush’s picture

Status: Needs review » Fixed
Issue tags: +rc eligible

This has been fixed in the latest dev version for 8.x-1.x and 2.0.x

Thanks for the patch, much appreciated.

owenbush’s picture

Assigned: bharath-kondeti » Unassigned
bharath-kondeti’s picture

StatusFileSize
new1.13 KB

Thanks @owenbush. I am attaching the patch with final changed that is committed on the git repo.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.