diff --git a/app/controllers/admin/feeds_controller.rb b/app/controllers/admin/feeds_controller.rb index bce6142..69e93f5 100644 --- a/app/controllers/admin/feeds_controller.rb +++ b/app/controllers/admin/feeds_controller.rb @@ -212,11 +212,13 @@ class Admin::FeedsController < OrbitAdminController site_feed.feed_name_translations = params[:feed][:title_translations] site_feed.disabled = false site_feed.feed_url = params[:feed][:url] - module_app = ModuleApp.where(:key=>site_feed.channel_key).first - sync_fields_data = SiteFeed::ModuleAppSyncFields.map{|f| [f, module_app[f]] }.to_h other_site_feed = SiteFeed.where(:remote_site_url=>site_feed.remote_site_url).first site_feed.channel_title_translations = other_site_feed.channel_title_translations if other_site_feed - site_feed.update(sync_fields_data) + module_app = ModuleApp.where(:key=>site_feed.channel_key).first + if module_app.feeds_model + sync_fields_data = SiteFeed::ModuleAppSyncFields.map{|f| [f, module_app[f]] }.to_h + site_feed.update(sync_fields_data) + end site_feed.save render :json => {"success" => true}.to_json end diff --git a/app/models/site_feed_annc.rb b/app/models/site_feed_annc.rb index ac9da6a..73b3453 100644 --- a/app/models/site_feed_annc.rb +++ b/app/models/site_feed_annc.rb @@ -163,9 +163,10 @@ class SiteFeedAnnc tmp["view_count"] = "" end feeds_time_field = self.feeds_time_field - if feeds_time_field - tmp[feeds_time_field] = tmp[feeds_time_field].blank? ? nil : tmp[feeds_time_field].to_time - end + feeds_time_field = 'postdate' if feeds_time_field.nil? + time_field_value = tmp[feeds_time_field] + tmp[feeds_time_field] = (time_field_value.blank? ? nil : time_field_value.to_time rescue time_field_value) + tmp[feeds_time_field] = time_field_value if tmp[feeds_time_field].nil? return tmp end def cache_annc(force_refresh=false,locales=nil,trans=nil)