Sticky Edit Actions uses "edit-actions" Id to apply it's functionality to the buttons. Media module uses multiform which doesn't apply ['actions'] for its buttons and because of that "edit-actions" Id is not present. It doesn't provide an alter hook for the form either.
More information can be found here #2065525: Use 'actions' for buttons.

Proposed solution for this problem is to add an alter hook for the multiform in Media module so that Sticky Edit Content module can add ['actions'] for the buttons by itself.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

binkaster’s picture

FileSize
963 bytes

Attached is a patch that adds alter hook for the multiform.

binkaster’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, media-2067091-1.patch, failed testing.

Elijah Lynn’s picture

Status: Needs work » Needs review

Whitespace cleanup and how about this as a comment, // Allow other modules to alter the form.

Elijah Lynn’s picture

Version: 7.x-1.0 » 7.x-2.0-unstable7

Also you will need to use the option --relative when generating this patch that is why the patch failed, see the URLs in the patch, they need to be relative to the Media module folder. Also changed version to 2.0 unstable.

Elijah Lynn’s picture

Title: Sticky Edit Actions doesn't work with the Media module's multiform "Save" and "cancel" buttons. » Sticky Edit Actions doesn't work with Media module's "Save" and "cancel" buttons.
Version: 7.x-2.x-dev » 7.x-2.0-unstable7
binkaster’s picture

FileSize
774 bytes

Adding the new corrected patch file.

Status: Needs review » Needs work

The last submitted patch, media-2067091-7.patch, failed testing.

Elijah Lynn’s picture

cd into the modules/media folder and run the command from there with --relative. Looks like you were one level too high up.

Elijah Lynn’s picture

Title: Sticky Edit Actions doesn't work with Media module's "Save" and "cancel" buttons. » Sticky Edit Actions doesn't work with Media multiform "Save" and "cancel" buttons.
binkaster’s picture

Title: Sticky Edit Actions doesn't work with Media multiform "Save" and "cancel" buttons. » Sticky Edit Actions doesn't work with Media module's "Save" and "cancel" buttons.
FileSize
744 bytes

Created a new patch according to suggestions above.

binkaster’s picture

FileSize
744 bytes

Changed patch name to match the comment.

Elijah Lynn’s picture

Title: Sticky Edit Actions doesn't work with the Media module's multiform "Save" and "cancel" buttons. » Sticky Edit Actions doesn't work with Media module's "Save" and "cancel" buttons.

Looks very good and it works!

+++ b/includes/media.pages.incundefined
@@ -57,6 +57,9 @@ function media_file_page_edit_multiple($files) {
+  // Allow other modules to alter the form

All comments should end in a period.

Other than that I tested this with Sticky Edit Actions and it works well with no negative impact on Media module other than making it more flexible.

Elijah Lynn’s picture

Title: Sticky Edit Actions doesn't work with Media module's "Save" and "cancel" buttons. » Sticky Edit Actions doesn't work with the Media module's multiform "Save" and "cancel" buttons.
Status: Needs work » Reviewed & tested by the community

Title: Sticky Edit Actions doesn't work with Media module's "Save" and "cancel" buttons. » Sticky Edit Actions doesn't work with the Media module's multiform "Save" and "cancel" buttons.
Status: Reviewed & tested by the community » Needs work

The last submitted patch, media-2067091-12.patch, failed testing.

Elijah Lynn’s picture

Version: 7.x-2.0-unstable7 » 7.x-2.x-dev
Status: Needs work » Needs review

Hrmm, maybe the patch failed because it was the wrong version. We are actually using 7.x-2.0-unstable7+38-dev

We should probably git clone the latest dev and roll the patch directly against that if this fails again.

Elijah Lynn’s picture

#12: media-2067091-12.patch queued for re-testing.

aaron’s picture

Title: Sticky Edit Actions doesn't work with Media module's "Save" and "cancel" buttons. » Sticky Edit Actions doesn't work with the Media module's multiform "Save" and "cancel" buttons.
Version: 7.x-2.0-unstable7 » 7.x-1.x-dev
Status: Needs review » Patch (to be ported)

Committed to http://drupalcode.org/project/media.git/commit/e68e32a. Just needs to be ported now, I believe. Thanks everyone.

Elijah Lynn’s picture

Issue summary: View changes
Related issues: +#2065525: Use 'actions' for buttons
Elijah Lynn’s picture

Issue summary: View changes
Elijah Lynn’s picture

Issue summary: View changes
Chris Matthews’s picture

Status: Patch (to be ported) » Closed (outdated)

Closing this issue as outdated. However, if you think this issue is still important, please let us know and we will gladly re-open it for review.
sincerely,
- the Drupal Media Team