- Issue created by @deciphered
- 🇳🇱Netherlands seanB Netherlands
As discussed on Slack, there are multiple ways to solve the issue.
- Should the media module add the attribute to CkEditor?
- Should the JSON API module allow fetching entities by just the entity type and UUID?
- Should you use other core endpoints (or a custom endpoint) to fetch a media entity by UUID?
I'm not convinced the media module should add the attribute to work around a limitation of the JSON API module. So I would probably vote against solution 1. Loading an entity by entity type and UUID is very common and should probably also be supported by any frontend solution.
The JSON:API Cross Bundles → module might be able to help loading the media entity when the bundle is unknown, which could be a solution for 2?
Creating a new contrib module with a custom endpoint is always a possibility, but not sure if that is needed if the JSON:API Cross Bundles → module solves it?
- 🇦🇺Australia deciphered
For me, as the developer and user of DruxtJS, having the bundle information opens up the ability for the frontend to pre-filter the requested JSON:API data as well as apply Bundle specific templating, which if is of great benefit to the frontend developer.
While I could certainly load the entity without knowing the bundle, via a non-core solution, it negates the ability to be able to pre-filter the query based on the bundle information.
I have put together a repository to demonstrate the issue, and to be my sandbox while I work on a solution. You can check it out @ https://github.com/Decipher/druxt-experiments/tree/feature/drupal_media
The repo is setup to be run on Gitpod @ https://gitpod.io#github.com/Decipher/druxt-experiments/tree/feature/dru...
Currently I have the frontend transpiling the unprocessed text field (as Drupal Media doesn't allow you to disable the filter if the CKEditor plugin is in use) which renders the DrupalMedia component: https://github.com/Decipher/druxt-experiments/blob/feature/drupal_media/...
- @deciphered opened merge request.
- 🇦🇺Australia alex.skrypnyk Melbourne
Re-roll #6 for 10.1 + re-compiled drupalMedia.js