First of all, thank you for the awesome module! :)
Noticed this behaviour with 'Flag 7.x-3.x', using the 'Dialog Box' option with the 'Form' link type.
After a brief look (js debugging) it turned out that the selector for $wrapper in Drupal.flagUtils.updateContentIdLinks is invalid.
The cause of the problem is that template_preprocess_flag() outputs the following class on the flag link:
function template_preprocess_flag(&$variables) {
// ... some code ...
$flag_css_name = str_replace('_', '-', $flag->name);
// ... some code ...
$variables['flag_wrapper_classes_array'][] = 'flag-' . $flag_css_name . '-' . $entity_id;
// ... some code ...
}
Then in the flagging_dialog.js file, the Drupal.flagUtils.updateContentIdLinks function uses the following as a selector for the wrapper to update:
var $wrappers = $('.flag-wrapper.flag-' + data.flagName + '-' + data.contentId);
It should instead look like the following (flag.js extends String: String.prototype.flagNameToCSS):
var $wrappers = $('.flag-wrapper.flag-' + data.flagName.flagNameToCSS() + '-' + data.contentId);
An example flag machine name that produces the above behaviour: comment_inappropriate.
I will create a patch and attach it soon!
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | flagging_form-flag-link-update-1890194-1.patch | 867 bytes | temaruk |
Comments
Comment #0.0
temaruk commentedAdded details.
Comment #1
temaruk commentedSee the attached patch!
Comment #2
Coornail commentedTested the patch, works like a charm!
Comment #3
misc commentedComment #4
misc commentedCommitted to the latest dev.
Comment #5.0
(not verified) commentedAdded details