Created
November 2, 2014 05:53
-
-
Save rvalyi/02cfc931f73a12b8bda3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#in case of error such as: | |
# "no implicit conversion of nil into String" when doing wagon pull | |
#You can spot the source of the problem doing wagon pull -v | |
#this patch helps skipping ad identifying the faulty entry | |
# in locomotivecms_mounter-1.4.4/lib/locomotive/mounter/reader/api/content_entries_reader.rb around line 124: | |
def retrieve_file_path(content_type, field, attributes) | |
value = attributes[field.name] | |
return nil if value.blank? | |
if !content_type.slug || !attributes['_slug'] | |
p "NNNNNNNNNNNNNNNNNNN", content_type, field, attributes | |
return nil | |
end | |
base_folder = File.join('/', 'samples', content_type.slug, attributes['_slug']) | |
if value.is_a?(Hash) | |
{}.tap do |translations| | |
value.each do |locale, url| | |
translations[locale] = self.add_content_asset(url, File.join(base_folder, locale)) | |
end | |
end | |
else | |
self.add_content_asset(value, base_folder) | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment