code_brown β created an issue.
code_brown β made their first commit to this issueβs fork.
@broon thanks for the patch, this works for our use case. I had to update the patch slightly so that it would apply against the latest version. It just removes the final patch stanza which appears to already be included in the target:
https://git.drupalcode.org/project/entity_reference_purger/-/blob/1.0.x/...
Apologies, this was coming from a different patch :-)
code_brown β created an issue.
Re-rolling patch #6 for 8.x-1.2
I think the reason the entity reference view display tries to load all results by default is that the entity_reference_options has limit set to 0 in https://git.drupalcode.org/project/drupal/-/blob/9.5.x/core/modules/view... and so it has to be limited by a call to:
$view->getDisplay()->setOption('entity_reference_options', ['limit' => $view->getItemsPerPage()]);
It looks to me like there should be a limit set when executing the view inside RestOaiPmhViewsCacheBase::processItem($data), similar to how it is done in rest_oai_pmh_cache_views() - because when the processItem() method is called we already know the offset and limit we're working with, so we shouldn't have to load all results for the view - if I'm understanding this correctly?
I've got a small patch I'll upload shortly that gets things working again for me, would be keen to get some feedback on whether I've understood this correctly or am missing how the queue/processItem system works?
Steps I used to reproduce the issue
- Create a Drupal 10 Lando development environment
- Composer install drupal/rest_oai_pmh, drupal/devel_generate
- Generate 100,000 nodes of type Article
- Create an entity reference source view of those articles
- Configure rest_oai_pmh to use that view and set cache strategy to Conservative (also set metadata format to oai_dc)
- Rebuild feed and observe out of memory error in SqlContentEntityStorage
- Apply patch, rebuild feed and it rebuilds successfully
We are also experiencing this issue on a site, it appears to run out of memory at the line:
$entities = $entity_storage->loadMultiple(array_unique($flat_ids));
when trying to load ~65k node ids, in web/core/modules/views/src/Plugin/views/query/Sql.php:1625
Digging into it a bit further, it seems to happen when processing field values for an entity_reference field that references other nodes, in our case when $table
equals node__field_member_of
in the following loop, it runs out of memory:
web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php:1229
I don't have a solution to this yet, just letting you know I'm also seeing it and this is where it borks for me. This also started happening after upgrading Drupal from 9.4.14 to 9.5.9.
This happens when:
* REST OAI-PMH Queue worker fires on cron
* Viewing the feed at /oai/request?verb=ListRecords&metadataPrefix=oai_dc
* Rebuilding the feed at /admin/config/services/rest/oai-pmh/queue
Just adding that I was also on the 1.0.0-alpha1 release, noticed icon paths were incorrect, updated to the 1.0.0 release and they are now fixed. Happy days.
code_brown β created an issue.
I have used https://www.drupal.org/project/ckeditor_html_embed β after removing the php 8.0 requirement and it suits our iframe embed needs, just make sure you have allowed iframe under "Ckeditor5 plugin settings" > "Source editing", on the "Text formats and editors" > "Configure" page.
The module uses the ckeditor5 html-embed plugin.
code_brown β created an issue.