Skip to content

Instantly share code, notes, and snippets.

@rvalyi
Created November 2, 2014 05:53
Show Gist options
  • Save rvalyi/02cfc931f73a12b8bda3 to your computer and use it in GitHub Desktop.
Save rvalyi/02cfc931f73a12b8bda3 to your computer and use it in GitHub Desktop.
#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