(For reasons to tiresome to explain - current guess is it was something to do with migration...)

It can be helpful or necessary to manually trigger a regeneration or reset of a media items designated thumbnail.

The code already provides an API call to do that pretty easily, but there seems to be no UI for it.
Drupal\media_entity\Entity\Media::automaticallySetThumbnail()

*Ideally* all parts of the system would always know how to keep the thumbnail up to date at all times, but issues ike
#2749695: Thumbnail not updated
#2786881: Recalculate thumbnail size during update
show this is not always straightforward.

Though it could be argued it's not *necessary* - it is *useful* . Ideally, the image_style management would always be up to date as well, yet the core image style management UI provides the 'flush' action on image styles as a utility anyway, and sometimes it's handy - especially during site migrations etc.

Exposing the 'Action' as an admin assistant seems easy and harmless. I did a local trial and it works as needed for me. I'll see if I can get a PR into github..

Comments

dman created an issue. See original summary.

dman’s picture

StatusFileSize
new302.88 KB

Pull request over at https://github.com/drupal-media/media_entity/pull/84 now.

Apologies if the protocol isn't quite right, I'm not up to speed on github ettiquette.

action in action

marcoscano’s picture

Status: Active » Needs review
Issue tags: +D8Media

Although normally at this point no new features should be getting added to the 1.x branch, the work here is done and could potentially help reduce some of the issues some users have with the thumbnail updating process.

Marking as Needs Review to have a second opinion on this.

@dman thanks for the contribution! Could you please also upload a patch here? This helps commenting on the issue for reviewers.

Thanks!

dman’s picture

StatusFileSize
new2.24 KB

Status: Needs review » Needs work

The last submitted patch, 4: 2869239-4.patch, failed testing.

dman’s picture

Those fails have nothing to do with me :-p

marcoscano’s picture

Status: Needs work » Needs review
StatusFileSize
new2.22 KB
new599 bytes

In tests the schema definition for config entities is enforced.
Let's see if the testbot likes it this time.

dman’s picture

Indeed ... I'm actually deep in the throes of schema validation vs test running woes in another project right now...
Requiring it for un-configurable actions seemed remarkably trivial to me, but *sigh*

anton-staroverov’s picture

Issue summary: View changes

Definitely need this patch to prevent confusion like #2749695-23: Thumbnail not updated. Also fixing link to "Thumbnail not updated".

ckaotik’s picture

This would still be a useful feature - is there any interest of porting this to Core media?

marcoscano’s picture

The equivalent (and more generic) issue for this in core is #2983456: Expose triggering update of media metadata + thumbnail to end users

anybody’s picture

Status: Needs review » Closed (outdated)

As of #11

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.