- 🇵🇹Portugal marcofernandes
Re-opening this issue because Media module is not mandatory and it should work with the media library provided by Gutenberg.
Hi, I made a custom Gutenberg block that contains image upload functionality. The custom block requires the MediaUpload from wp.blockEditor, and on fresh copy of Drupal with few images are working well, I can upload images, I can attache images without any problem.
The problem started when I move the custom block into a website where is hundreds of images, the at this point it stop working. The media library popup is empty and I get error in the console:
Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0
When we investigate the source of the problem we find out that media library using this API - /editor/media/search/image/*
The API looking for the all images in the media library and when we go to that link directly it has an error:
Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in web/core/lib/Drupal/Core/Entity/ContentEntityBase.php on line 746
I assume this is happens because of too many request this API do, and our server does not have enough memory allocated for the process.
I was wonder if there is a way to set the image search for the specific category in the media library, or is there is any other solutions you can suggest instead let the media library search for all of the images in the media library?
Active
3.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Re-opening this issue because Media module is not mandatory and it should work with the media library provided by Gutenberg.