I'm trying to apply fotorama format to image field and getting error : Call to undefined function template_preprocess_image_formatter() in template_preprocess_fotorama_gallery_image_item()

CommentFileSizeAuthor
settings.png28.58 KBroomit
error.txt7.04 KBroomit
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

roomit created an issue. See original summary.

roomit’s picture

Issue summary: View changes
meickol’s picture

Priority: Critical » Normal

Please, Can you tell me more about your drupal environment? drupal version?

roomit’s picture

I have Drupal 8.3.1 on my local server (Openserver, https://ospanel.io/) with Apache 2.4.25, PHP 7.1 andMySQL 5.7.

meickol’s picture

I am testing the module on this new drupal version, and yes I see this error, I fixed it clearing the cache after enabling the module, if you are using drush

drush cr

I hope for now that will let you work with the module, but I will go deeper on this. Thanks and let me know if this works for you.

martin107’s picture

After a chat with meickol in IRC

It was working on 8.2.7, but reported to be failing on 8.3.1 and 8.3.2

I can reproduce this error on 8.4.x

the function that cannot be found exists in the core as

image.field.inc - template_preprocess_image_formatter()

The question why it has become disconnected.

I am looking into this further.... watch this space.

but for the moment here is the stack trace

17-May-2017 21:17:10 Europe/Berlin] Error: Call to undefined function template_preprocess_image_formatter() in /Users/martin/sites/drupal/modules/fotorama_gallery/fotorama_gallery.module on line 31 #0 /Users/martin/sites/drupal/core/lib/Drupal/Core/Theme/ThemeManager.php(287): template_preprocess_fotorama_gallery_image_item(Array, 'fotorama_galler...', Array)
#1 /Users/martin/sites/drupal/core/lib/Drupal/Core/Render/Renderer.php(435): Drupal\Core\Theme\ThemeManager->render('fotorama_galler...', Array)
#2 /Users/martin/sites/drupal/core/lib/Drupal/Core/Render/Renderer.php(195): Drupal\Core\Render\Renderer->doRender(Array, false)
#3 /Users/martin/sites/drupal/core/lib/Drupal/Core/Template/TwigExtension.php(490): Drupal\Core\Render\Renderer->render(Array)
#4 /Users/martin/sites/drupal/sites/default/files/php/twig/591ae2e9680c2_fotorama-gallery-field.ht_BX1H8y8Ih3Z3obLH0UWvK98ir/w4bzfZ05B7Hsk_cUJ2Ga79ff6agjRicoCsDWUXkKzsA.php(114): Drupal\Core\Template\TwigExtension->escapeFilter(Object(Drupal\Core\Template\TwigEnvironment), Array, 'html', NULL, true)
#5 /Users/martin/sites/drupal/vendor/twig/twig/lib/Twig/Template.php(432): __TwigTemplate_8c16247cfa0b9835602c4d46c84b67bf025c933e3df168abebc42049e9b5871b->doDisplay(Array, Array)
#6 /Users/martin/sites/drupal/vendor/twig/twig/lib/Twig/Template.php(403): Twig_Template->displayWithErrorHandling(Array, Array)
#7 /Users/martin/sites/drupal/vendor/twig/twig/lib/Twig/Template.php(411): Twig_Template->display(Array)
#8 /Users/martin/sites/drupal/core/themes/engines/twig/twig.engine(64): Twig_Template->render(Array)
#9 /Users/martin/sites/drupal/core/lib/Drupal/Core/Theme/ThemeManager.php(384): twig_render_template('modules/fotoram...', Array)
#10 /Users/martin/sites/drupal/core/lib/Drupal/Core/Render/Renderer.php(435): Drupal\Core\Theme\ThemeManager->render('fotorama_galler...', Array)
#11 /Users/martin/sites/drupal/core/lib/Drupal/Core/Render/Renderer.php(448): Drupal\Core\Render\Renderer->doRender(Array)
#12 /Users/martin/sites/drupal/core/lib/Drupal/Core/Render/Renderer.php(195): Drupal\Core\Render\Renderer->doRender(Array, false)
#13 /Users/martin/sites/drupal/core/lib/Drupal/Core/Template/TwigExtension.php(490): Drupal\Core\Render\Renderer->render(Array)
#14 /Users/martin/sites/drupal/sites/default/files/php/twig/591ae2e9680c2_node.html.twig_P4BQvAKBFovvw9i7naZmbh0bQ/FWm2QcLOmClElynveJliFkVrFmDKM41N_7lYf7NZrnk.php(114): Drupal\Core\Template\TwigExtension->escapeFilter(Object(Drupal\Core\Template\TwigEnvironment), Array, 'html', NULL, true)
#15 /Users/martin/sites/drupal/vendor/twig/twig/lib/Twig/Template.php(432): __TwigTemplate_4ae59022820823361d314fdb0db03eda142ac3295eb1399a7323e963e3d3bf5a->doDisplay(Array, Array)
#16 /Users/martin/sites/drupal/vendor/twig/twig/lib/Twig/Template.php(403): Twig_Template->displayWithErrorHandling(Array, Array)
#17 /Users/martin/sites/drupal/vendor/twig/twig/lib/Twig/Template.php(411): Twig_Template->display(Array)
#18 /Users/martin/sites/drupal/core/themes/engines/twig/twig.engine(64): Twig_Template->render(Array)
#19 /Users/martin/sites/drupal/core/lib/Drupal/Core/Theme/ThemeManager.php(384): twig_render_template('core/themes/bar...', Array)
#20 /Users/martin/sites/drupal/core/lib/Drupal/Core/Render/Renderer.php(435): Drupal\Core\Theme\ThemeManager->render('node', Array)
#21 /Users/martin/sites/drupal/core/lib/Drupal/Core/Render/Renderer.php(195): Drupal\Core\Render\Renderer->doRender(Array, false)
#22 /Users/martin/sites/drupal/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(226): Drupal\Core\Render\Renderer->render(Array, false)
#23 /Users/martin/sites/drupal/core/lib/Drupal/Core/Render/Renderer.php(574): Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}()
#24 /Users/martin/sites/drupal/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(227): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#25 /Users/martin/sites/drupal/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(117): Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\CurrentRouteMatch))
#26 /Users/martin/sites/drupal/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php(90): Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\CurrentRouteMatch))
#27 /Users/martin/sites/drupal/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(108): Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object(Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent), 'kernel.view', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#28 /Users/martin/sites/drupal/vendor/symfony/http-kernel/HttpKernel.php(158): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object(Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent))
#29 /Users/martin/sites/drupal/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#30 /Users/martin/sites/drupal/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#31 /Users/martin/sites/drupal/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony:
meickol’s picture

@martin107 I found the problem here you can see more information https://www.drupal.org/node/2638622#comment-12100180

  • meickol committed cd7313e on 8.x-1.x
    Issue #2872036 by roomit, meickol, martin107, mondrake:...
meickol’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

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