Download & Extend

Insert module doesn't work with Drupal 7.20

Project:Insert
Version:7.x-1.2
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

As of drupal 7.20 has been released insert module doesn't properly insert images.

Update notes:

The security fixes in this release change all image derivative URLs generated by Drupal to append a token as a query string. (As an example, links that previously pointed to a URL like http://example.com/sites/default/files/styles/thumbnail/public/field/ima... will now point to a URL like http://example.com/sites/default/files/styles/thumbnail/public/field/ima....)

Comments

#1

Status:active» closed (works as designed)

I have old links from my production env, works as designed and closed. Sorry.

#2

Status:closed (works as designed)» active

I disagree with this being closed. Insert fails to generate an image using an image style for me since Drupal 7.20.

#3

Status:active» needs review

I have update my links on stag env, but some links are broken yet. It seems that image styles inserted with insert module hasn't been created. Does anyone have similar poblem?

#4

Status:needs review» active

#5

Thanks for quick replay. I was thinking it is only my problem.

#6

On my site, some of the image styles work with "Insert", others don't. Didn't figure out yet, why.

#7

Olafski, for some images you have image's styles generated by other modules perhaps, as I have.

#8

Status:active» needs review

This patch resolve this issue.

Please review.

AttachmentSize
1923336.patch 854 bytes

#9

Yes, it works, but overall I have to use absolute paths to see images after save a node. With relative paths I can only see images in wyswigy editor, but not after saving a node. Any ideas why?

#10

I turned off pathologic module and now relative paths work also. But what I should do with existing links? It is really a lot of work to manually reinsert all images...

#11

micz_ thanks for your review!

#10
"I turned off pathologic module and now relative paths work also."
This is a different issue

"But what I should do with existing links? It is really a lot of work to manually reinsert all images..."

This is a good question, but not this issue. :)

If you agree whit this, please set this issue to rtbc

#12

"But what I should do with existing links? It is really a lot of work to manually reinsert all images..."

Make a little filter module which replace old links to new with image_style_url.

#13

Status:needs review» reviewed & tested by the community

pp, thanks for help! :) should I create issue on pathologic issue queue?

#14

#12 I have no idea how to do that...

#15

Status:reviewed & tested by the community» needs review

micz_ make an issue in Drupal Core issue queue.

#16

Status:needs review» reviewed & tested by the community

#17

@micz_ #7, I guess on my site it's "Responsive images and styles", so I created an issue there: #1923936: Responsive images and styles module doesn't work with Drupal 7.20

#18

Title:doesn't work with drupal 7.20» Insert module doesn't work with Drupal 7.20

Changing the title a bit, since I'm going to link to this from the Drupal 7.20 release announcement and release notes (in the "known issues" section)...

The patch seemed to work for me also. If it's necessary to make it work with older versions of Drupal core too, the new code could be wrapped in a function_exists('image_style_path_token') check. (Right now, I think it will lead to a fatal error with older versions.)

#19

@ micz_

http://drupal.org/project/ispreg is a temporary solution for broken links. Remember to install VBO.

@ pp #8
Patch doesn't work with File (Field) Paths.

#20

przemekz(or anybody): could you help me to clarify "doesn't work" ?

1. Patch made for insert module not File (Field) Paths. Did you try to apply this patch for File (Field) Paths git repository?

2. Could you write a short usecase to me? I never use File (Field) Paths and Insert module together. If I can't reproduce your problem, then I can't resolve it.

#21

Status:reviewed & tested by the community» needs review

David_Rothstein: #18 is a good point.

Please review.

AttachmentSize
1923336-13.patch 957 bytes

#22

micz_ #12
Here is the module: https://drupal.org/project/1924318/git-instructions

Please try it.

Usage:

Enable module
go to the Text formats admin page (admin/config/content/formats) and enable filter to all formats (see picture.)

AttachmentSize
setup_filter.png 116.61 KB

#23

pp #22
It does the job! Great :) How it works? I Can see itoken attached to the end of img links only in view mode in my content body field but not in edit view-source wyswigy mode.

I have uninstall this module, flush cache and image cache, install corrector again and I have itoken added twice. I have a local copy of db, but somebody else could not have it.

Sorry for my english.

#24

micz_ https://drupal.org/node/1924618 This is a different issue, a different module.

#25

@ #20
I obviously patched Insert module.

I have File (Field) Paths installed and created path for images (field) "images/[current-date:custom:Y]_[current-date:custom:W]/field_images". My public directory is "files" not "sites/default/files".

When I upload and insert some image with style then the image's path is for example /files/styles/my-style/public/myfile.png?itok=0eCQczX- and is OK.
But when I save the node then the uploaded image's path is /files/images/2013_08/field_images/myfile.png. The uploaded image is moved to the custom directory and the path in body field is updated. The new path for the style is /files/styles/my-style/public/images/2013_08/field_images/myfile.png?itok=0eCQczX- and the image doesn't exist.

I suppose that the image_style_path function (image.inc) is never called using as argument /files/images/2013_08/field_images/myfile.png and so the file /files/styles/my-style/public/images/2013_08/field_images/myfile.png?itok=0eCQczX- will never be created.

Sorry for first detailed description it was 2:17 am.

#26

Patch #21 works
Thanks

#27

Patch # 21 works, I have tested on all of my client's site, thanks

#28

przemekz #25

Thank's for clarifying. I can reproduce the bug.

This is an File (Field) Paths module bug, because it modifies the image path, but not regenerates image token:
http://drupal.org/node/1925298

bluehead, Qandeel(or anybody who test this patch :) )
Thank's for your review.
Can you change issue status to rtbc?

#29

Patch #21 works!

#30

I think this patch should be considered major and I am hoping a quick fix release from maintainer of this module. Can we have some words from the maintainer.???

#31

Status:needs review» reviewed & tested by the community

I've reviewed the patch and it seems OK. Comments #18, #26, #27, #29 state that it's tested as well.

#32

Status:reviewed & tested by the community» fixed

Thanks guys, appreciate the effort. Committed to 7.x-1.x branch and I'll make a new release shortly.

#33

Status:fixed» closed (fixed)

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

nobody click here