I applied an update to Flexslider, to 8.x-2.x-dev, and now cannot view the manage display page on any of my nodes.

In the Apache error logs, I get this error (curtailed to remove certain elements):

ResponsiveImageFormatter' not found in FlexsliderResponsiveFormatter.php on line 25

Although this issue appears to discuss a similar problem, I am not getting a resolution. I never had the Responsive Images module enabled, tried turning it on, got a WSOD, then uninstalled it again, and I am back to the same place.

Had to uninstall the field formatter submodule to get everything to work. again.

Not sure if this is a bug, or if I am configuring it wrong?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

RKopacz created an issue. See original summary.

amaria’s picture

Ok. I'll write some tests to see if I can reproduce the issue.

RKopacz’s picture

Thanks for the quick response. The site in question is ready to go into production, and I was hoping to use FS for one of the slide shows, so I am available for quick-turnaround manual testing on this end as well.

amaria’s picture

If you need this right away, just use the patch in https://www.drupal.org/node/2797537 to set responsive image as a dependency until I can figure out what's happening.

RKopacz’s picture

Thanks, I'll do that. Will follow this issue closely, happy to test new patches.

amaria’s picture

@RKopacz are you using the patch from https://www.drupal.org/node/2797537 that adds the dependency on responsive image? If so, can you remove the patch, clear cache, uninstall responsive image and try again with this patch? If it doesn't work, try clearing the cache again. If it still doesn't work, I'll have to try more drastic measures.

I was able to reproduce the error. Looks like I caused the bug by taking out some code that I shouldn't have. After adding the attached patch code and rebuilding the cache, it worked.

amaria’s picture

Status: Active » Needs review
RKopacz’s picture

Hi @amaria, sorry for the delay in responding to this, and thank you for the patch. I will test it now. I will use drush to download a fresh copy of flex slider (having some problems with Composer), and will apply the patch to that. I need to then install it fresh, because I uninstalled the previous instance that I was using.

I will let you know the results.

RKopacz’s picture

Ok I just enabled the module views and fields submodules after the patch. Just before that, I redownloaded the module using Drush. the module was actually still installed, only the views and fields submodules were uninstalled.

(interesting side note: when I uninstalled the views submodule, it also seemed to delete the view that was using it. Is this intended behavior?)

I am able to visit the Manage Display page for content types. When I visit a multi item image field, I get a Flexslider formatter. I had cleared the cache twice before attempting anything.

I note that the formatter only appears where there are multi item image fields. Where the image is set to one image, the formatter is not available.

I was unable to do that much before. I will next select the field formatter for a content type with a multi item image field and see what we get.

amaria’s picture

Status: Needs review » Fixed

Ok, I'll keep an eye on this if it comes up again but for now I'll mark as fixed. Particularly since I haven't gotten any other complaints about it. I believe it mostly has to do with clearing the cache after (un)installing modules.

  • amaria committed d7b0e95 on 8.x-2.x
    Issue #2845747 by amaria: ResponsiveImageFormatter' not found in...
RKopacz’s picture

@amaria the patch does not seem to work. Following from #9, I selected the Flexslider field formatter for my multi-item image field, and was able to save it. But when visiting a node with existing content in that field for that content type, I got a WSOD where only the node title appeared, unformatted, when I try to view the node.

See the attached screenshot.

I am going to try to use a prior version of FS to see if I can get this working again. Right now, I am having a hard time changing the display setting to something other than Flexslider, after having set it.

RKopacz’s picture

FileSize
441.08 KB

Adding a screenshot of how the content item looks with a different field formatter.

RKopacz’s picture

Status: Fixed » Needs work
RKopacz’s picture

Also adding entries in the error logs:

[Thu Feb 02 06:53:31.133616 2017] [:error] [pid 1891] [client 127.0.0.1:57160] PHP Fatal error:  Call to a member function getValue() on a non-object in /var/www/wildlife/themes/adaptivetheme/at_core/at_core.theme on line 1238, referer: http://wildlife.development.com/admin/structure/types/manage/photo_gallery/display
[Thu Feb 02 06:53:37.499598 2017] [:error] [pid 1894] [client 127.0.0.1:57169] PHP Fatal error:  Call to a member function getValue() on a non-object in /var/www/wildlife/themes/adaptivetheme/at_core/at_core.theme on line 1238, referer: http://wildlife.development.com/admin/structure/types/manage/photo_gallery/display
[Thu Feb 02 06:58:11.188884 2017] [:error] [pid 8140] [client 127.0.0.1:57508] PHP Fatal error:  Call to a member function getValue() on a non-object in /var/www/wildlife/themes/adaptivetheme/at_core/at_core.theme on line 1238, referer: http://wildlife.development.com/admin/structure/types/manage/photo_gallery/display
[Thu Feb 02 06:58:21.563680 2017] [:error] [pid 8125] [client 127.0.0.1:57751] PHP Fatal error:  Call to a member function getValue() on a non-object in /var/www/wildlife/themes/adaptivetheme/at_core/at_core.theme on line 1238, referer: http://wildlife.development.com/admin/structure/types/manage/photo_gallery/display
[Thu Feb 02 07:02:09.197015 2017] [:error] [pid 8125] [client 127.0.0.1:58225] PHP Fatal error:  Call to a member function getValue() on a non-object in /var/www/wildlife/themes/adaptivetheme/at_core/at_core.theme on line 1238, referer: http://wildlife.development.com/node/71
[Thu Feb 02 07:17:39.417372 2017] [:error] [pid 1891] [client 127.0.0.1:60138] PHP Fatal error:  Call to a member function getValue() on a non-object in /var/www/wildlife/themes/adaptivetheme/at_core/at_core.theme on line 1238, referer: http://wildlife.development.com/node/71
[Thu Feb 02 07:22:54.165054 2017] [:error] [pid 10240] [client 127.0.0.1:60688] PHP Fatal error:  Call to a member function getValue() on a non-object in /var/www/wildlife/themes/adaptivetheme/at_core/at_core.theme on line 1238, referer: http://wildlife.development.com/node/71
[Thu Feb 02 07:26:59.526473 2017] [:error] [pid 1894] [client 127.0.0.1:33005] PHP Fatal error:  Call to a member function getValue() on a non-object in /var/www/wildlife/themes/adaptivetheme/at_core/at_core.theme on line 1238, referer: http://wildlife.development.com/node/71
[Thu Feb 02 07:30:16.514682 2017] [:error] [pid 8125] [client 127.0.0.1:33462] PHP Fatal error:  Call to a member function getValue() on a non-object in /var/www/wildlife/themes/adaptivetheme/at_core/at_core.theme on line 1238, referer: http://wildlife.development.com/node/71
amaria’s picture

Looks like a problem with your theme. Try changing the theme to the default bartik and see if that works. It looks like a conflict with image caption.

RKopacz’s picture

@amaria Wow, great catch! It would have taken me much longer to track that down, so thank you. I'll post something in Adaptivetheme queue just to alert Jeff Burnz to the issue.

Thanks again and sorry for the trouble.

amaria’s picture

Status: Needs work » Fixed

Ok, great! So this issue can be closed. If you find another problem, feel free to create another issue.

Jeff Burnz’s picture

#16 no, this is not a problem with theme, but a problem coming from the module.

Flexslider is removing #item from the render array:

Standard Drupal field image $variables['items'] array (kint() from preprocess field image)

Flex slider $variables['items']

values are protected and the only way to get these is to use the method getValue() e.g.

        foreach ($variables['items'] as $delta => $item) {
          $values = $item['content']['#item']->getValue();

I think other extensions/themes/templates/preprocess etc should be OK with expecting the normal items array to be there, and call standard Drupal methods e.g. getValue().

E.g. this is totally legit:

{% set alt = item.content['#item'].getValue().alt %}
{{ alt }}

But this would no longer work, and if you try to do this in preprocess it will blow up your site. The way Flexslider is working is expecting nothing like this to ever happen, but that's a bit crazy, of course people are going to do this in field--image template, so this will be an ongoing issue for years. You're setting a quite difficult precedent for theming here, themes need consistent array, because array of doom is already mad enough, and now we must check every time, everywhere, if variable isset before we call standard method on standard array item?

Jeff Burnz’s picture

Is a possible/passable solution for Flexslider to hook_theme_registry_alter and force it's own preprocess for the field images it uses and have it's own field image template?

amaria’s picture

Ok, @Jeff Burnz. Thanks for the input! This is a pretty big holdover from the D7 version. Will look into it but it's separate from this issue so I'll create another.

Status: Fixed » Closed (fixed)

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