Sorry for machine translation ... Drupal is updated to version 7.20, and pop-up picture simply not be displayed. What can be done?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Firnas’s picture

Title: After the upgrade, collapsed » Problems after the upgrade to 7.20
Version: 7.x-1.x-dev » 7.x-1.0-alpha1
Category: support » bug

Hello,
I am having the same issue with this module. on 7.x-1.x-dev also.

I am using hover_preview formatter in a view block display with action 'replace image', and after the update to drupal core 7.20 the view does not output the images of new content ( the new token is not there at the end of the file)

@sayansk: sorry I had to modify the title a bit to be more descriptive.

caw67’s picture

dev-version dont work: similar problem here. after update drupal to 7.20 no hover previews are shown!
the replace images function works...

version 1a works with clean cache, deacivate caching

Firnas’s picture

My website also have imagecache_actions installed, I noticed I am having this problem whenever the image style called includes an effect from imagecache_actions.
I tried this also with hover_preview alpha1 (with and without caching enabled) with no luck.

The problem is that the replaced image style does not include a token as expected in 7.20. Hover preview formatter only build the replaced image url. I made a change and it all went well.

Please find attached a patch of the change I did.

sayansk’s picture

It did not help :(

Firnas’s picture

@sayansk: I still don't know what could be exactly the problem at your side. Please provide more information of how/where you are using the hover_preview.

But first, drupal 7.21 was released today to fix incompatibilities introduced in the Drupal 7.20 security release, you can check if this would fix your problem.
if not, please check if your problem could be fixed by setting the 'image_allow_insecure_derivatives' variable to TRUE. This can be done using Drush, or by placing $conf['image_allow_insecure_derivatives'] = TRUE; in your settings.php file.

MGParisi’s picture

Still have the problem with drupal 1.21 and image_allow_insecure_derivatives is set to true on my site. I have to revert back to 1.19 as there are too many problems with 1.21

I cant apply the patch as their is no line

$hover_uri = image_style_path($display['settings']['hover_preview_style'], $item['uri']);

MGParisi’s picture

I found the code though it was different then in the patch and replaced it with "image_style_url" with no luck. This patch broke hover preview when I reverted back to 7.19.

UPDATE: After a few more attempts I was able to finally figure it out. My problem was related to a sub domain issue that caused the hover_preview and fivestars from working. With the fix being to set the $base_url in the settings.php file!

sayansk’s picture

Tried to restore a working version 7.19 and over again, progressively, to upgrade to 7.22. When you update, everything was in order, and when the updated core program again everything stopped working. What you suggested, I've tried. The proposed patch is not appropriate (probably with a different version). Nothing helped. By the way, at the same time still stops working module views_infinite_scroll.
Here is what I have:
Drupal:
Drupal core 7.22
Modules:
Address Field 7.x-1.0-beta3
Administration menu 7.x-3.0-rc4
Bank Transfer | Ubercart Payment 7.x-1.0-beta1
CAPTCHA 7.x-1.0-beta2
Chaos tool suite (ctools) 7.x-1.3
Colorbox 7.x-2.4
Entity API 7.x-1.0
FileField Sources 7.x-1.7
Hover Preview for ImageCache 7.x-1.x-dev (2011-мая-12)
Image Preview 7.x-1.0-alpha1
Libraries API 7.x-2.1
Meta tags quick 7.x-2.7
Rules 7.x-2.3
Secure Pages 7.x-1.0-beta1
Taxonomy Title 7.x-1.5
Token 7.x-1.5
Ubercart 7.x-3.4
Views 7.x-3.7
Views Infinite Scroll 7.x-1.1

sayansk’s picture

Do all works?

gb2world’s picture

I'm also seeing the problem (Drupal 7.21, Hover Preview 7.x-1.x-dev). The hover preview will display if the hover preview style is the original image. If I try and use a preset, it stops working. There are no errors reported. I've tried the suggested updates for the settings.php file for image_allow_insecure_derivatives and base_url, with no impact.

If I diff the resultant pages of the original image vs. the image with preset, the only difference is the itok token set in the path of the image for hover preview. The path to the image appears to be correct. Could something be amiss with the token?

klausenlie’s picture

I don`t know if it`s neccessary to post another comment saying that I have this bug too, but my Drupal versjon is 7.22. Is this a Drupal issue or related to the new version I installed. This was when the bug occured, but at the same time I updated some modules. Can`t remember which right now.

What I am more interested to know is what the status is on this bug. Is it being looked at?

I would like to say that Hoover Preview is a great module and I have had lot`s of great experiences with it.

klausenlie’s picture

Hi!

I was just wondering what the status is on this topic.

MGParisi’s picture

It does not work on all configurations for drupal 7.20 and above. Someone needs to update the module to point to the image with the token attached.

Turkish Delight’s picture

I am using Drupal 7.22 and I found that the "Hover" feature only works when the "Hover preview style" (in Views configuration > Configure Field) is set to "None (original image)".
As a temporary fix, you can add the following lines to the "hover_preview.imgpreview.css" file:

margin-top:-200px; /*This is not a required line, but does affect the placement of the image on the page*/
max-width:450px; /*This line shrinks the image to a maximum width (you are welcome to change this width)*/

The entire file looks like this:

#hover-preview-imgpreview {
  background: #222 url(loading.gif) no-repeat center;
  -moz-border-radius: 10px;
  -webkit-border-radius: 10px;
  border-radius: 10px;
  padding: 10px;
  z-index: 999;
  border: none;
  margin-top:-200px; /*Custom Edit*/
  max-width:450px; /*Custom Edit*/
}
MGParisi’s picture

That just re-sizes the original image. That's not a good fix.

klausenlie’s picture

Hi!

I have found out that the directory path to the preview image is missing the image to preview. How come there`s no picture in the directory?

fantom84’s picture

this is my workaround:
use the patch from post #3

file `hover_preview.module`

<?php
     if (isset($display['settings']['hover_preview_style']) && !empty($display['settings']['hover_preview_style'])) {
-      $hover_uri = image_style_path($display['settings']['hover_preview_style'], $item['uri']);
+      $hover_uri = image_style_url($display['settings']['hover_preview_style'], $item['uri']);
       $element[$delta]['#attributes']['data-hover-preview'] = file_create_url($hover_uri);
     }
?>

then, in the imgpreview.min.jquery.js file change the line:

.match(/\.(gif|jpe?g|png|bmp)$/i)

to

.match(/\.(gif|jpe?g|png|bmp)/i)

description:
Starting from Drupal 7.20, Drupal adds additional tokens to all images paths, so now the function `image_style_path` doesn't create an image (https://api.drupal.org/comment/49618#comment-49618). After fix that using the patch above we also need to change the regexp in the js file because in our new URL (with tokens) the URL string does not have the file type at the end.

htortosa’s picture

Not work form me.

Only with the "no change style" works.

Finally works ok. Sorry.

Berliner-dupe’s picture

#17

Thank you very much. It works perfect!

Terebinth’s picture

#17 worked for me. Thanks!

gb2world’s picture

Thank you, fantom84 - #17 worked with Hover Preview 7.x-1.0-alpha1

FL26’s picture

Issue summary: View changes

Thank you very much, fantom84 ! #17 worked also worked for my site.

fenstrat’s picture

Title: Problems after the upgrade to 7.20 » Problems after the upgrade to Drupal core 7.20
Status: Active » Reviewed & tested by the community
FileSize
3.35 KB

Here's #17 in patch format. As per feedback from #18 to #22 marking this as RTBC.

dqd’s picture

Title: Problems after the upgrade to Drupal core 7.20 » Missing Drupal core > 7.20 support: hover_preview images being NOT shown no more
Version: 7.x-1.0-alpha1 » 7.x-1.x-dev
Status: Reviewed & tested by the community » Needs review
FileSize
3.35 KB

Please set status to "needs review" when uploading a new patch or version to get community feedback and Drupal system auto testing for it. Also RTBC should never be set after uploading of new patches or new versions of them to ensure code quality before commit, even if older versions are already discussed before. I'll reuplaod and rename patch of @fenstrat based on #3 and #17 for community feedback and to requeue for testing. Rename patch regarding Drupal patch name conventions. Look here https://drupal.org/project/hover_preview/git-instructions.

BTW: "Problems" is not a good summary for an issue. I'll change the title to lead to more details of the issue case.

dqd’s picture

Ok, main module maintainer didn't set project page to "testing enabled" yet. D.O. testing on "Needs review" state not available for hover_preview patches ATM.

dqd’s picture

BTW: I have running a D7.28 test enviroment here with hover_review. Can anyone confirm that this issue still exists? I can't reproduce it here atm.

fenstrat’s picture

Status: Needs review » Reviewed & tested by the community

This issue still exists with latest D7 core.

This module has no .test file(s) so any d.o testing will not happen, hence I went straight to RTBC as per feedback from #18 to #22. Moving back to RTBC.

c8n’s picture

I think RTBC is a lil bit overhasty here ...

fenstrat’s picture

@c8n can you elaborate please? Did you experience the issue, apply the patch, and it didn't solve the issue?

I can confirm the patch fixes the issue, as does everyone from #18 to #22.

This is RTBC.

Liliplanet’s picture

Hi! I've added the patch as per #12 and able to see the hover images in my views preview,

but on the actual view there is no hover and in the log entry ..

Unable to generate the derived image located at public://styles/thumbnail/public/products/2_1.jpg.

Would most appreciate the fix, thank you :)

fenstrat’s picture

@Liliplanet can you confirm you're using the patch from #24 (or #23 as they're exactly the same)?

Liliplanet’s picture

@fenstrat thank you so much for your reply. I've patched from #24 and now do not receive errors in the log entry but preview is still not happening.

wondering if I'm missing something fundamental here, most appreciate your help :)

fenstrat’s picture

@Liliplanet odd, have you saved your view and look at it from the front end of the site (i.e. not just the admin preview)? Worth a try, however my admin preview of the view is working as well.

Andre-B’s picture

I am going to commit #24 after reviewing and testing it again against 7.x today.

spoiler: 8.x version incoming as well.

Andre-B’s picture

Patch from #24 was not created against latest 7.x-1.x. this one is.

Andre-B’s picture

Patch tested locally and on simplytest.me going to commit.

  • Andre-B authored 641b6d5 on 7.x-1.x
    Issue #1932340 by fenstrat, Andre-B, diqidoq, Firnas, fantom84: Missing...

  • Andre-B authored 9d3ab51 on 8.x-1.x
    Issue #2797687 by Andre-B: Drupal 8: Port of hover_preview - moved js,...
Andre-B’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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