diff --git a/app/controllers/events_controller.rb b/app/controllers/events_controller.rb index 54bf98e53..20da27e2d 100644 --- a/app/controllers/events_controller.rb +++ b/app/controllers/events_controller.rb @@ -183,7 +183,7 @@ def index end citation_years = if total.positive? - facet_annual(response.response.aggregations.citation_years.buckets) + facet_by_cumulative_year(response.response.aggregations.citation_years.buckets) end prefixes = if total.positive? diff --git a/app/controllers/old_events_controller.rb b/app/controllers/old_events_controller.rb index 8be6be5ba..712a802d2 100644 --- a/app/controllers/old_events_controller.rb +++ b/app/controllers/old_events_controller.rb @@ -178,7 +178,7 @@ def index end citation_years = if total > 0 - facet_annual(response.aggregations.citation_years.buckets) + facet_by_cumulative_year(response.aggregations.citation_years.buckets) end citation_types = if total > 0 diff --git a/app/models/event.rb b/app/models/event.rb index 381475411..981b226a4 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -958,17 +958,10 @@ def obj_cache_key end def citation_year - unless (INCLUDED_RELATION_TYPES + RELATIONS_RELATION_TYPES).include?( - relation_type_id, - ) - "" - end subj_publication = - subj["datePublished"] || subj["date_published"] || - (date_published(subj_id) || year_month) + subj["datePublished"] || subj["date_published"] obj_publication = - obj["datePublished"] || obj["date_published"] || - (date_published(obj_id) || year_month) + obj["datePublished"] || obj["date_published"] [subj_publication[0..3].to_i, obj_publication[0..3].to_i].max end