FIX: ensure we never collide ids in the JIVE API importer

This commit is contained in:
Régis Hanol 2017-06-06 16:13:07 +02:00
parent 17c29c972b
commit 4e8e9c2d2f

View File

@ -137,7 +137,7 @@ class ImportScripts::JiveApi < ImportScripts::Base
loop do
contents = get("#{path}?#{filters}&sort=dateCreatedAsc&count=#{POST_COUNT}&startIndex=#{start_index}", to_import[:authenticated])
contents["list"].each do |content|
content_id = content["contentID"].presence || content["id"]
content_id = content["contentID"].presence || "#{content["type"]}_#{content["id"]}"
custom_fields = { import_id: content_id }
custom_fields[:import_permalink] = content["permalink"] if content["permalink"].present?