Actions
Defect #38992
openHow do I use helper_queries_column_value helper hook?
Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:
0%
Estimated time:
Resolution:
Affected version:
Description
In app/helpers/queries_helper.rb, there is:
  def column_value(column, item, value)
    content = ...
    call_hook(:helper_queries_column_value,
              {:content => content, :column => column, :item => item, :value => value})
    content
  end
In my xxx_helper_queries_column_value_hook.rb:
  def helper_queries_column_value(context = { })
    if context[:column].name ==  :action
      context[:content] = "Ushiro" 
    end
  end
I can change the parameter context, but when I checked in app/helpers/queries_helper.rb, I found that the variable content is not updated. So what's the proper way of using this hook? My guess is that this piece of code:
    call_hook(:helper_queries_column_value,
              {:content => content, :column => column, :item => item, :value => value})
    content
should be revised to:
    content = call_hook(:helper_queries_column_value,
              {:content => content, :column => column, :item => item, :value => value})
    content
       Updated by Like HOPPER over 1 year ago
      Updated by Like HOPPER over 1 year ago
      
    
    Indeed, what is this hook for? And how should we use it? Does it allow to modify the display of an attribute in a list?
Actions