Fix #4282: Related tag search no longer allows the JSON/XML formats.

This commit is contained in:
evazion
2020-02-05 14:38:32 -06:00
parent 2d0e0769cb
commit ccb87e13b1
3 changed files with 3 additions and 3 deletions

View File

@@ -217,7 +217,7 @@ module ApplicationHelper
def body_attributes(user, params, current_item = nil)
current_user_data_attributes = data_attributes_for(user, "current-user", current_user_attributes)
if params[:action] == "show" && current_item.present?
if current_item.present? && current_item.respond_to?(:html_data_attributes) && current_item.respond_to?(:model_name)
model_name = current_item.model_name.singular.dasherize
model_attributes = current_item.html_data_attributes
current_item_data_attributes = data_attributes_for(current_item, model_name, model_attributes)