Problem/Motivation

There's a @todo in the docblock of \claro_preprocess_fieldset__media_library_widget that says:

@todo Remove this when https://www.drupal.org/project/drupal/issues/2999549 lands.

Proposed resolution

Address the todo comments.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3156739

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

lauriii created an issue. See original summary.

lauriii’s picture

himanshu_sindhwani’s picture

Assigned: Unassigned » himanshu_sindhwani
himanshu_sindhwani’s picture

Status: Active » Needs review
StatusFileSize
new2.45 KB

Addressed the todo. Here is the patch.

sharma.amitt16’s picture

Assigned: himanshu_sindhwani » Unassigned
Status: Needs review » Reviewed & tested by the community
+++ b/core/themes/seven/seven.theme
@@ -321,21 +321,6 @@ function seven_preprocess_media_library_item__small(array &$variables) {
- * @todo Remove this when https://www.drupal.org/project/drupal/issues/2999549

@himanshu thanks for the patch. The reference issue given in the file is fixed now.

@todo is taken in consideration.

Looks good now.

Changing status to RTBC.

lauriii’s picture

Status: Reviewed & tested by the community » Needs work

I assume that the @todo comment says we should use the Drupal\Core\Utility\LinkGenerator for generating the link instead of a render array. This should be addressed before removing the comment.

himanshu_sindhwani’s picture

StatusFileSize
new5.15 KB

Thanks for the clarification @laurii, did the same in this patch.

himanshu_sindhwani’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 7: 3156739-7.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

lauriii’s picture

thedrupalkid’s picture

StatusFileSize
new6.14 KB

Resolved tests.

hardik_patel_12’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 13: 3156739.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

phenaproxima’s picture

raman.b’s picture

Status: Needs work » Needs review
StatusFileSize
new6.87 KB
new3.62 KB

This should resolve the failed test cases from #13

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

longwave’s picture

Version: 9.5.x-dev » 10.1.x-dev
Status: Needs review » Needs work
Issue tags: +Needs reroll

Patch needs rerolling.

+++ b/core/modules/media_library/src/Plugin/Field/FieldWidget/MediaLibraryWidget.php
@@ -84,12 +92,15 @@ class MediaLibraryWidget extends WidgetBase implements TrustedCallbackInterface
+    $this->linkGenerator = $link_generator;

We can't just add this here, we have to provide backward compatibility and a deprecation in case someone extended this class. We can't add new deprecations in 9.5.x or 10.0.x so this has to go to 10.1.x now.

Ankit.Gupta’s picture

Version: 10.1.x-dev » 9.5.x-dev
Issue tags: -Needs reroll
StatusFileSize
new20.17 KB

Reroll the patch #17 with Drupal 9.5.x

spokje’s picture

Version: 9.5.x-dev » 10.1.x-dev
Issue tags: +Needs reroll

Thanks @Ankit.Gupta, but you've might have missed this comment:

We can't just add this here, we have to provide backward compatibility and a deprecation in case someone extended this class. We can't add new deprecations in 9.5.x or 10.0.x so this has to go to 10.1.x now.

So the reroll has to be against 10.1.x-dev,, not 9.5.x-dev.

vsujeetkumar’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new5.41 KB

Re-roll given against 10.1.x, Please have a look.

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs Review Queue Initiative, +Needs issue summary update, +Needs change record

This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request as a guide.

Please include an interdiff with your patch

We can't just add this here, we have to provide backward compatibility and a deprecation in case someone extended this class. We can't add new deprecations in 9.5.x or 10.0.x so this has to go to 10.1.x now.

has not been addressed

Tagging for change record also for the new paramter

longwave’s picture

Title: Address @todo in seven_preprocess_fieldset__media_library_widget » Address @todo in claro_preprocess_fieldset__media_library_widget

Retitling the issue given that Seven has been removed, but Claro has the same code.

spokje’s picture

Assigned: Unassigned » spokje
Issue tags: -Seven

Removing Seven tag and self-assigning

spokje’s picture

Issue summary: View changes
Issue tags: -Needs issue summary update

Updated IS

spokje’s picture

Issue tags: -Needs change record

Added draft CR and switched to MR-workflow.

spokje’s picture

Assigned: spokje » Unassigned
Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Thank you @Spokje for adding the trigger_error.

Reviewing the MR code everything looks clean
Deprecation has been added
Deprecation is being tested
New functions have correct typehints

Ran the test locally without the fix and got

Failed asserting that string matches format description.
--- Expected
+++ Actual
@@ @@
 @expectedDeprecation:
-%A  Calling Drupal\media_library\Plugin\Field\FieldWidget\MediaLibraryWidget::__construct without

Verified that the claro media library widget works fine.

Great job!

bnjmnm’s picture

Status: Reviewed & tested by the community » Needs work

Tested manually in Claro and spotted some regressions

  • "Show media item weights" button is not styled and is mising the following classes
    .action-link action-link--extrasmall .action-link--icon-show .media-library-widget__toggle-weight
  • "Add Media" button is missing the .media-library-open-button class. This one I'm unsure if the class is used anywhere, but even if Claro is internal this should probably be preserved unless there's a compelling reason to get rid of it.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

spokje’s picture

This is the plain diff from the 10.1.x: https://git.drupalcode.org/project/drupal/-/merge_requests/3323.diff

Using that on top of a new MR, based on 11.x.

(Rebasing an MR from 10.something.x to 11.x is a nightmare, at least to me, and there where no threads, not even closed on the 10.1.x MR.)

alphex’s picture

This needs to be re-rolled for Drupal 10.3.6

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

alphex’s picture

This is rooted in a SIX+ year old issue, that just needs to have 10 lines of code removed that impacts some classes on a base theme...

Can we get this closed out?