Needs review
Project:
Content Synchronization
Version:
5.0.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
8 May 2025 at 20:53 UTC
Updated:
16 Jun 2026 at 20:22 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
kul.pratap commentedWorking on it.
Comment #3
ergonlogicI've updated method signatures to align with upstream interfaces. But now I'm seeing:
As far as I can tell, here it's misinterpreting the "id" field (integer) as an entity reference field, and failing to load the referenced entity.
Comment #4
ergonlogic@star-szr pointed out that, in
content_sync.services.yaml, thecontent_sync.normalizer.entity_reference_field_itemservice points to #2575761: Discuss a better system for discovering and selecting normalizers. That ticket notes that:We tried commenting out that service, and then see:
Here's it's trying to use the
LinkItemNormalizeron anIntergerItem.Comment #5
star-szrThis change record seems relevant for changes required for the normalizers: https://www.drupal.org/node/3359695
Comment #6
ergonlogicI implemented the change from
$supportedInterfaceOrClassto::getSupportedTypes()inNormalizerclasses, with promising results.The nature of the error has now changed:
Comment #7
ergonlogicLooks like this is the relevant change record: https://www.drupal.org/node/3185520
Comment #8
ergonlogicRemoving the deprecated 'return' query option resolved that issue and appeared to allow a bunch of exports, before running into:
Comment #9
star-szr@kul.pratap I believe when you commented that an issue fork with changes had already been started by @ergonlogic so this may not be the best issue to jump into since we are already actively working on it. I'm going to go ahead and unassign for now. Thank you for wanting to contribute!
Comment #10
star-szrRegarding the serializers, this old issue seems worth pointing out: #3255826: Leverage Core Serializers
Edit: Not for the scope of this issue, but as a longer-term consideration for the maintenance of this module.
Comment #11
ergonlogicThis latest issue appears to be due to an unconfigured private filesystem, which is the default in DDEV. Configuring it in
settings.phpallowed all of the files to be written:Perhaps it'd be worth adding a check for this setting in
Drupal\serialization\Normalizer\ContentEntityNormalizer::normalize(), before trying to write to the private filesystem?This allowed the batch process to complete, but then result in a WSOD:
Comment #12
ergonlogicThat last error looks like a false positive. I had previously commented-out the initial snapshot taken in
hook_install(). Re-enabling that and re-installing the module has resulted in a successful export.The "Synchronize" tab no longer shows any deleted items, so that's encouraging too.
I guess testing importing would be the logical next step.
Comment #13
ergonlogicRunning imports via Drush, I got:
This was fixed pretty easily by allowing file entities to be returned from
FileEntityNormalizer::denormalize().Comment #14
star-szrFor the most recent error see also #3486660: FileEntityNormalizer::denormalize(): Return value must be of type ArrayObject|array|string|int|float|bool|null.
Edit: although looking at the fix there, it's not doing the right thing in my opinion.
Comment #15
ergonlogicI got this error when trying to import:
Which really is not terribly useful. The stacktrace doesn't mention any code in
content_syncat all...I was eventually able to import all of our content by specifying all of the entity types in a particular order:
So perhaps there's something wrong with the dependency graph, or whatever is used to determine the order of import.
At any rate, this is working for our use case. We will continue to use and test it as we proceed with the project. I'll provide updates here if/when I run into any other issues. However, I'm going to set this issue to "Needs work", so others can weigh in.
Comment #16
ergonlogicHere's a patch of the MR branch that should work against the most recent release on the 4.0.x branch.
Comment #17
ergonlogicWe've been successfully using this in several D11 projects for a while now. Marking as "Needs review" to get more eyes on this.
That said, testing this can be bit tricky, since we need the project's
composer.jsonto support D11. You can use the issue fork repo and branch like so:Comment #18
blanca.esqueda commentedHi @ergonlogic :)
I added you as a maintainer.
Comment #19
ergonlogicThis is currently flagged as applying to
4.0.x-dev. However, we're currently at4.0.0-RC2, which is the recommended release. Would we want to move to a5.0.xbranch for this?Comment #20
mikkmiggur commentedCan this go at least to Dev? Then it can try with D11.
Comment #21
yukare commentedI think the better is to create a new 5.0.x branch. This way you can raise the required php to one used by Drupal 11, and can make changes that breaks previous versions of drupal and php. Once we have a Drupal 11 working(even on dev/beta) more people can use it to test and help with any issue.
Comment #22
ergonlogicI created a
5.0.xbranch, and a5.0.x-devrelease, for easier testing and evaluation of the fixes in this issue.