lib/scrivito/cms_backend.rb in scrivito_sdk-1.7.0 vs lib/scrivito/cms_backend.rb in scrivito_sdk-1.8.0.rc1
- old
+ new
@@ -20,10 +20,11 @@
cached_workspace_state = CmsDataCache.read_workspace_state(id)
cached_csid = cached_workspace_state.try(:first)
cached_workspace_data_tag = cached_workspace_state.try(:second)
+ id = normalize_id(id)
changes = CmsRestApi.get("/workspaces/#{id}/changes", {from: cached_csid}, options)
update_obj_cache(id, cached_csid, changes)
raw_workspace_data, workspace_data_tag = update_workspace_cache(
@@ -59,24 +60,24 @@
def self.find_blob_data(id, access, verb, options = {})
if blob_data = find_blob_data_from_cache(id, access, verb, options)
blob_data
else
- id = normalize_blob_id(id)
+ id = normalize_id(id)
blob_datas = request_blob_datas_from_backend(id, options)
store_blob_datas_in_cache(id, options, blob_datas)
blob_datas[access][verb]
end
end
def self.find_blob_data_from_cache(id, access, verb, options)
- cache_key = blob_data_cache_key(normalize_blob_id(id), access, verb, options)
+ cache_key = blob_data_cache_key(normalize_id(id), access, verb, options)
CmsDataCache.cache.read(cache_key)
end
def self.find_binary_meta_data(blob_id)
- blob_id = normalize_blob_id(blob_id)
+ blob_id = normalize_id(blob_id)
cache_key = "binary_meta_data/#{blob_id}"
if meta_data = CmsDataCache.cache.read(cache_key)
meta_data
else
meta_data = CmsRestApi.get("blobs/#{blob_id}/meta_data")['meta_data']
@@ -216,11 +217,11 @@
else param
end
end
private_class_method :normalize_search_param
- def self.normalize_blob_id(id)
+ def self.normalize_id(id)
CmsRestApi.normalize_path_component(id)
end
- private_class_method :normalize_blob_id
+ private_class_method :normalize_id
end
end