I am using fasttoggle views plugin to add a field to set/unset stickyness of nodes in the view.
Trying to replace the text link with an image using CSS, I found that CSS class according to status, was missing.
So I checked the code in fasttoggle_views_handler_field_node_link.inc file, and at line 52:
return fasttoggle($options[$key][intval($node->$key)], 'node/'. $node->nid .'/toggle/'. $key, TRUE, $key .'_'. $node->nid);
the fasttoggle function is defined in fasttoggle.module file at line 132, as:
function fasttoggle($title, $callback, $html = TRUE, $token = '', $class = '') {}
Comparing, you can see that no value is passed to the function for $class variable. So the output class is only "fasttoggle" and it is only updated by JS only at first click on a link. But this way it is impossible to apply CSS theming at first rendering of the view.
To solve the issue, I changed the code in the views plugin file to be:
return fasttoggle($options[$key][intval($node->$key)], 'node/'. $node->nid .'/toggle/'. $key, TRUE, $key .'_'. $node->nid, 'fasttoggle-status-node-' . $key . '-' . $node->{$key});
Could you check the my changement, and commit it if it is working correctly?
Thank you,
G.Paolo
Comments
Comment #1
nigelcunningham commentedThanks for this report. You're absolutely correct. Fix committed and will be in the 1.5 stable release, which I hope to prepare shortly.
Comment #2.0
(not verified) commentedmissing semicolon