Problem/Motivation
ContentExporter::$entityReferenceCache and $entityOutputCache are instance properties that doExportToYml() never clears, so they leak between exports in the same request.
Several export paths emit only a stub when the reference cache reports an entity as already seen. It is correct within one document and wrong across documents: each .yml is imported on its own, and ContentImporter::createStubEntity() then saves a hollow entity with no custom field values, and without an error.
Bulk export calls doExportToYml() once per entity in a loop (ContentFileGenerator::generateBulkZipFile()), so every file after the first can be short.
Steps to reproduce
Bulk export two entities that share a referenced entity. The second file will be smaller than the same entity exported on its own as it only contains a stub for the shared entity.
Proposed resolution
Clear both caches at the top of doExportToYml() so that every document is self-contained.
User interface changes
None.
API changes
None.
Data model changes
None.
Issue fork single_content_sync-3622549
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments