Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
The media overview page has an "Add media" local action button, which is lost in the table view if we install the Media Library module. It is present in the grid view, but not in the table view:
Proposed resolution
Add the button back :)
Comments
Comment #2
Krilo_89 CreditAttribution: Krilo_89 at Synetic commentedLooks like the action link from the media_library is wrong. Changed "
appears_on
" to-view.media.media_page_list
.Added patch to display the "Add Media" button to the media library table display.
-edit-
Will also create a test to check if the 'Add media' button exists on the library table page.
Comment #3
Krilo_89 CreditAttribution: Krilo_89 at Synetic commentedComment #4
sjerdoSeems good. Add media button appears on the media library view page.
We should add a test for this.
Comment #5
Krilo_89 CreditAttribution: Krilo_89 at Synetic commentedAdded the test and made an interdiff.
Comment #6
Krilo_89 CreditAttribution: Krilo_89 at Synetic commentedComment #7
Krilo_89 CreditAttribution: Krilo_89 at Synetic commentedSmall error on the test and changed the description. Added a new patch with interdiff.
Comment #10
marcoscanoThanks for working on this! Just a minor consideration:
Why don't we leave the original assertion there, and just add some lines at the end of the existing test that:
- Assert that you can click on the "Table" tab
- Assert that after clicking there, the URL is /admin/content/media-table
- Assert that the "Add media" link is present there too.
Creating a new test just for that would prepare all the environment again, with the setup, etc., and I have the feeling that it would be overkill in this case.
Also, could you please upload a patch only with the test? That would prove that the bug exists and that the fix is a real fix.
Thanks!
Comment #11
Krilo_89 CreditAttribution: Krilo_89 at Synetic commentedI did what you asked and removed the second test and added it at the end of the existing test. (I also added some variables for the page and the session on the top of the test)
The first patch is the one with the test only, so this will fail. The second patch is the one with test and solution, which wil pass. Also added a interdiff between 7 and 11.
Comment #12
Krilo_89 CreditAttribution: Krilo_89 at Synetic commentedComment #14
marcoscanoThank you! I don't see anything else to complain about here.
Comment #16
alexpottNeeds to be rerolled.
Comment #17
pguillard CreditAttribution: pguillard commentedComment #18
pguillard CreditAttribution: pguillard commentedRerolled
Comment #20
seanBLooking great! Thanks.
Comment #21
alexpottCrediting @sjerdo, @marcoscano for reviews.
Committed 91ab96a and pushed to 8.6.x. Thanks!