This feature is necessary to be able to integrate http://drupal.org/project/media_crop with the Media Filter. Attached a patch (against 7.x-1.0-rc2) that is needed for the module to work properly.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

aaron’s picture

Status: Active » Needs review

for the testbot

Dave Reid’s picture

Version: 7.x-1.0-rc2 » 7.x-2.x-dev

We'll need to have this applied to 7.x-2.x first, and also documented in media.api.php.

dddave’s picture

media_filter_alter_hook.patch queued for re-testing.

Dave Reid’s picture

I had a use for this in a project so I gave this a review and it seems handy to have for now. Here's a revised patch including some documentation and re-rolled for the current code.

Status: Needs review » Needs work

The last submitted patch, 1382150-media-token-to-markup-alter.patch, failed testing.

Dave Reid’s picture

Status: Needs work » Needs review
FileSize
4.94 KB

Note that the original patch had:
drupal_alter('media_token_to_markup', $element, $file, $tag_info);

And this has:
drupal_alter('media_token_to_markup', $element, $tag_info, $settings);

This is because it's important that we pass along $settings to the alter hooks (since we'd want to be able to check $settings['wysiwyg']), and since drupal_alter() is limited to three parameters, we included $file in $tag_info['file'] instead.

Dave Reid’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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