I’m on D9.
I’ve a node edit form with a media field using the media library widget.
When a new media is added I’d need to run some custom code to replace one token, of the media path location, depending on the value of the node itself.
However, the route available with Drupal::routeMatch()
is media_library.ui
and there is no node object available
I suppose this is correct, as the code is execute during the request "inside the media library widget".
Thus, i’m trying to find if is possibile somehow to get the "mainoriginal" request from in that moment and the relative node object or if it is impossible. In the latter case, do you have idea if that objective is somehow possible?