Right now there is no context to the flag in question (aside from some various data injected via $info). Will attach a patch shortly.

Comments

markhalliwell’s picture

Title: Include $flag for reference in hook_flag_javascript_info() » Include $flag for reference in hook_flag_javascript_info_alter()
Status: Active » Needs review
StatusFileSize
new845 bytes
fabianx’s picture

Status: Needs review » Reviewed & tested by the community

It is always nice to pass contextual data as further parameters to drupal_alter. Works nicely here.

joachim’s picture

Status: Reviewed & tested by the community » Needs work

Looks good, but a change in function behaviour needs a corresponding change in documentation!

markhalliwell’s picture

Status: Needs work » Needs review
StatusFileSize
new1.87 KB

Ironically, the API documentation itself was already inaccurate. Here's an updated patch.

Status: Needs review » Needs work

The last submitted patch, 4: 2177859-flag_flag_javascript_info_alter-4.patch, failed testing.

markhalliwell’s picture

Status: Needs work » Needs review
StatusFileSize
new1.87 KB

Sigh, edited it an old IDE (which doesn't pick that stuff up). Here's the correct patch.

joachim’s picture

Status: Needs review » Fixed

Committed. Thanks for the fixes to the docs!

git commit -m "Issue #2177859 by Mark Carver: Added \$flag parameter to hook_flag_javascript_info_alter()." --author="markcarver "

joachim’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.