Fix bug.
This commit is contained in:
		
							parent
							
								
									d3a42b1132
								
							
						
					
					
						commit
						23cba34a97
					
				|  | @ -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 | ||||
| 		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 | ||||
|  |  | |||
|  | @ -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) | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue