When I upload an image to a node on 2 separate servers I am getting an issue where I don’t get a thumbnail created or any image styles. Locally it works as it should and image styles are created??
The hot air balloon preview is working as it should and creates the folder hierarchy on the server but images styles just won’t create and I can’t work out why? I am fairly certain this isn’t a files permission issue as this is something I have checked.
My site is built on Drupal8 and this issue started after I made updates to these modules: config_ignore, dropzonejs, focal_point (8.x-1.0-beta5) & search_api
The focal_point module contained this database update:
/** * Migrates image fields to use a dedicated focal point image widget. */ function focal_point_update_8004() { $ mapping = \Drupal::service('entity_field.manager')->getFieldMapByFieldType('image'); $ formStorage = \Drupal::entityTypeManager()->getStorage('entity_form_display'); $ previewLink = \Drupal::config('focal_point.preview')->get('display_link'); \Drupal::service('plugin.manager.field.widget')->clearCachedDefinitions(); foreach ($ mapping as $ entity => $ fields) { foreach ($ fields as $ fieldName => $ def) { foreach ($ def['bundles'] as $ bundle) { $ properties = [ 'targetEntityType' => $ entity, 'bundle' => $ bundle, ]; if ($ formDisplays = $ formStorage->loadByProperties($ properties)) { /** @var \Drupal\Core\Entity\Entity\EntityFormDisplay $ formDisplay */ foreach ($ formDisplays as $ formDisplay) { $ componentConfig = $ formDisplay->getComponent($ fieldName); if (is_array($ componentConfig) && $ componentConfig['type'] === 'image_image') { $ componentConfig['type'] = 'image_focal_point'; $ componentConfig['settings']['preview_link'] = $ previewLink; $ componentConfig['settings']['offsets'] = '50,50'; $ formDisplay->setComponent($ fieldName, $ componentConfig)->save(); } } } } } } \Drupal::configFactory()->getEditable('focal_point.preview')->delete(); }
I’m hoping someone can help me with this?
I am getting this notice in my drupal logs:
Notice: Undefined offset: 1 in Drupal\Core\Entity\EntityDisplayRepository->getAllDisplayModesByEntityType() (line 115 of /var/www/spherelife.com/public_html/core/lib/Drupal/Core/Entity/EntityDisplayRepository.php) #0 /var/www/spherelife.com/public_html/core/includes/bootstrap.inc(566): _drupal_error_handler_real(8, ‘Undefined offse…’, ‘/var/www/sphere…’, 115, Array) #1 /var/www/spherelife.com/public_html/core/lib/Drupal/Core/Entity/EntityDisplayRepository.php(115): _drupal_error_handler(8, ‘Undefined offse…’, ‘/var/www/sphere…’, 115, Array) #2 /var/www/spherelife.com/public_html/core/lib/Drupal/Core/Entity/EntityDisplayRepository.php(142): Drupal\Core\Entity\EntityDisplayRepository->getAllDisplayModesByEntityType(‘view_mode’) #3 /var/www/spherelife.com/public_html/core/lib/Drupal/Core/Entity/EntityDisplayRepository.php(78): Drupal\Core\Entity\EntityDisplayRepository->getDisplayModesByEntityType(‘view_mode’, ‘node’) #4 /var/www/spherelife.com/public_html/core/lib/Drupal/Core/Entity/EntityManager.php(397): Drupal\Core\Entity\EntityDisplayRepository->getViewModes(‘node’) #5 /var/www/spherelife.com/public_html/core/lib/Drupal/Core/Entity/EntityViewBuilder.php(390): Drupal\Core\Entity\EntityManager->getViewModes(‘node’) #6 /var/www/spherelife.com/public_html/core/lib/Drupal/Core/Entity/EntityViewBuilder.php(181): Drupal\Core\Entity\EntityViewBuilder->isViewModeCacheable(‘full’) #7 /var/www/spherelife.com/public_html/core/modules/node/src/NodeViewBuilder.php(60): Drupal\Core\Entity\EntityViewBuilder->getBuildDefaults(Object(Drupal\node\Entity\Node), ‘full’) #8 /var/www/spherelife.com/public_html/core/lib/Drupal/Core/Entity/EntityViewBuilder.php(138): Drupal\node\NodeViewBuilder->getBuildDefaults(Object(Drupal\node\Entity\Node), ‘full’) #9 /var/www/spherelife.com/public_html/core/lib/Drupal/Core/Entity/EntityViewBuilder.php(111): Drupal\Core\Entity\EntityViewBuilder->viewMultiple(Array, ‘full’, NULL) #10 /var/www/spherelife.com/public_html/core/lib/Drupal/Core/Entity/Controller/EntityViewController.php(96): Drupal\Core\Entity\EntityViewBuilder->view(Object(Drupal\node\Entity\Node), ‘full’) #11 /var/www/spherelife.com/public_html/core/modules/node/src/Controller/NodeViewController.php(55): Drupal\Core\Entity\Controller\EntityViewController->view(Object(Drupal\node\Entity\Node), ‘full’, NULL) #12 [internal function]: Drupal\node\Controller\NodeViewController->view(Object(Drupal\node\Entity\Node), ‘full’, NULL) #13 /var/www/spherelife.com/public_html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array) #14 /var/www/spherelife.com/public_html/core/lib/Drupal/Core/Render/Renderer.php(576): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber{closure}() #15 /var/www/spherelife.com/public_html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) #16 /var/www/spherelife.com/public_html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) #17 [internal function]: Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber{closure}() #18 /var/www/spherelife.com/public_html/vendor/symfony/http-kernel/HttpKernel.php(153): call_user_func_array(Object(Closure), Array) #19 /var/www/spherelife.com/public_html/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 2) #20 /var/www/spherelife.com/public_html/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 2, true) #21 /var/www/spherelife.com/public_html/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 2, true) #22 /var/www/spherelife.com/public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(99): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 2, true) #23 /var/www/spherelife.com/public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(78): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 2, true) #24 /var/www/spherelife.com/public_html/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 2, true) #25 /var/www/spherelife.com/public_html/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(50): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 2, true) #26 /var/www/spherelife.com/public_html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 2, true) #27 /var/www/spherelife.com/public_html/core/lib/Drupal/Core/EventSubscriber/DefaultExceptionHtmlSubscriber.php(165): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 2) #28 /var/www/spherelife.com/public_html/core/lib/Drupal/Core/EventSubscriber/CustomPageExceptionHtmlSubscriber.php(119): Drupal\Core\EventSubscriber\DefaultExceptionHtmlSubscriber->makeSubrequest(Object(Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent), ‘/node/97’, 403) #29 /var/www/spherelife.com/public_html/core/lib/Drupal/Core/EventSubscriber/CustomPageExceptionHtmlSubscriber.php(71): Drupal\Core\EventSubscriber\CustomPageExceptionHtmlSubscriber->makeSubrequestToCustomPath(Object(Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent), ‘/node/97’, 403) #30 /var/www/spherelife.com/public_html/core/lib/Drupal/Core/EventSubscriber/HttpExceptionSubscriberBase.php(109): Drupal\Core\EventSubscriber\CustomPageExceptionHtmlSubscriber->on403(Object(Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent)) #31 /var/www/spherelife.com/public_html/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(108): Drupal\Core\EventSubscriber\HttpExceptionSubscriberBase->onException(Object(Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent), ‘kernel.exceptio…’, Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher)) #32 /var/www/spherelife.com/public_html/vendor/symfony/http-kernel/HttpKernel.php(230): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(‘kernel.exceptio…’, Object(Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent)) #33 /var/www/spherelife.com/public_html/vendor/symfony/http-kernel/HttpKernel.php(79): Symfony\Component\HttpKernel\HttpKernel->handleException(Object(Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException), Object(Symfony\Component\HttpFoundation\Request), 1) #34 /var/www/spherelife.com/public_html/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #35 /var/www/spherelife.com/public_html/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #36 /var/www/spherelife.com/public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(99): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #37 /var/www/spherelife.com/public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(78): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true) #38 /var/www/spherelife.com/public_html/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #39 /var/www/spherelife.com/public_html/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(50): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #40 /var/www/spherelife.com/public_html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #41 /var/www/spherelife.com/public_html/core/lib/Drupal/Core/DrupalKernel.php(657): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #42 /var/www/spherelife.com/public_html/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #43 {main}.