Duplicate URL for image with... with :class in :url #660

Closed
kenips opened this Issue Dec 2, 2011 · 6 comments

Projects

None yet

8 participants

@kenips

Hi, just wondering if paperclip is simply reading the path and reporting them as identical? Perhaps it should check that if :class is included in path then a clash won't happen? Thanks.

[paperclip] Duplicate URL for image with /system/:class/:attachment/:id/:basename-:style.:extension. This will clash with attachment defined in Your class
[paperclip] Duplicate URL for image with /system/:class/:attachment/:id/:basename-:style.:extension. This will clash with attachment defined in My class
@sikachu sikachu closed this in b4ff2c5 Dec 12, 2011
@uberllama

Think something got missed. I'm seeing this with 3.0 (upgrading from 2.4.1). No idea what's causing it:

[paperclip] Duplicate URL for image with :s3_domain_url. This will clash with attachment defined in Avatar class
[paperclip] Duplicate URL for image with :s3_domain_url. This will clash with attachment defined in Group class

I have the following in an initializer:

Paperclip::Attachment.default_options.merge!(
  :url => ':s3_domain_url',
  :path => ':class/:attachment/:id/:style/:filename'
)

...so that multiple classes with attachments use the same path format without having to specify the same format in their has_attached_file declarations.

@mhuggins

I'm seeing this too for classes that have two completely different strings. Here's my (condensed) setup:

class Advertisement::ImageBanner < ActiveRecord::Base
  has_attached_file :image,
    :path => 'advertisements/image_banner/:id_partition/:style/:basename.:extension'
end

class Advertisement::TextBanner < ActiveRecord::Base
  has_attached_file :image,
    :path => 'advertisements/text_banner/:id_partition/:style/:basename.:extension'
end

And the warning messages I'm seeing:

[paperclip] Duplicate URL for image with /system/:attachment/:id/:style/:filename. This will clash with attachment defined in Advertisement::ImageBanner class
[paperclip] Duplicate URL for image with /system/:attachment/:id/:style/:filename. This will clash with attachment defined in Advertisement::TextBanner class
@phene

I get something similar:

Paperclip::Attachment.default_options[:path] = "tenants/:tenant_id/:class/:id/:file_name_with_style"
Paperclip::Attachment.default_options[:url] = ":s3_path_url"
[paperclip] Duplicate URL for data with :s3_path_url. This will clash with attachment defined in ProfilePhoto class
@tusharc

+1

@brian5150

Has this been resolved? Thanks.

@bamorim

Same problema here, has this been solved?

Thank you.

@urbanautomaton urbanautomaton added a commit to urbanautomaton/paperclip that referenced this issue Sep 19, 2012
@urbanautomaton urbanautomaton Check attachment paths for duplicates, not URLs
As per discussion in issue #660, attachments using alias interpolations
for the attachment URL mistakenly get flagged as being duplicates,
although the interpolation expands to a unique location.

This commit (partially) addresses the issue by checking the attachment path
instead. However, the problem will remain for users who use
interpolations other than :class to distinguish attachment paths for
different models.
d86f202
@jyurek jyurek added a commit that referenced this issue Nov 2, 2012
@urbanautomaton urbanautomaton Check attachment paths for duplicates, not URLs
As per discussion in issue #660, attachments using alias interpolations
for the attachment URL mistakenly get flagged as being duplicates,
although the interpolation expands to a unique location.

This commit (partially) addresses the issue by checking the attachment path
instead. However, the problem will remain for users who use
interpolations other than :class to distinguish attachment paths for
different models.
716f159
@robg robg added a commit to robg/paperclip that referenced this issue Jan 4, 2013
@urbanautomaton urbanautomaton Check attachment paths for duplicates, not URLs
As per discussion in issue #660, attachments using alias interpolations
for the attachment URL mistakenly get flagged as being duplicates,
although the interpolation expands to a unique location.

This commit (partially) addresses the issue by checking the attachment path
instead. However, the problem will remain for users who use
interpolations other than :class to distinguish attachment paths for
different models.
536136b
@jyurek jyurek added a commit that referenced this issue Feb 8, 2013
@urbanautomaton urbanautomaton Check attachment paths for duplicates, not URLs
As per discussion in issue #660, attachments using alias interpolations
for the attachment URL mistakenly get flagged as being duplicates,
although the interpolation expands to a unique location.

This commit (partially) addresses the issue by checking the attachment path
instead. However, the problem will remain for users who use
interpolations other than :class to distinguish attachment paths for
different models.
71b95cf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment