diff --git a/lib/tasks/announcement_link_widget.rake b/lib/tasks/announcement_link_widget.rake index dd4201f..78b5c39 100644 --- a/lib/tasks/announcement_link_widget.rake +++ b/lib/tasks/announcement_link_widget.rake @@ -30,14 +30,16 @@ namespace :announcement_link_widget do end if common_tags_frontend.size > 0 - Bulletin.all.can_display.is_approved.order_by(:created_at=>'desc').each do |ann| + Bulletin.all.can_display.is_approved.order_by(:postdate=>'desc').each do |ann| intersection = ann.tags & an_tags if intersection.size > 0 intersection.each do |t| name = t.name.downcase.gsub(" ", "_") index = common_tags_frontend.index{|t| t["tag-id"] == name} ctf = common_tags_frontend[index] - ctf["announcements"] << {"title" => ann.title_translations[locale.to_s],"link"=>OrbitHelper.widget_item_url(ann.to_param)} + if ann.title_translations[locale.to_s] != "" + ctf["announcements"] << {"title" => ann.title_translations[locale.to_s],"link"=>OrbitHelper.widget_item_url(ann.to_param)} + end end end end @@ -50,7 +52,9 @@ namespace :announcement_link_widget do name = t.name.downcase.gsub(" ", "_") index = common_tags_frontend.index{|t| t["tag-id"] == name} ctf = common_tags_frontend[index] - ctf["links"] << {"title" => wl.title_translations[locale.to_s],"url" => wl.url_translations[locale.to_s]} + if wl.title_translations[locale.to_s] != "" + ctf["links"] << {"title" => wl.title_translations[locale.to_s],"url" => wl.url_translations[locale.to_s]} + end end end end