Closed (fixed)
Project:
Content Synchronization
Version:
3.0.x-dev
Component:
Code
Priority:
Major
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
29 Dec 2022 at 15:07 UTC
Updated:
9 Oct 2024 at 03:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #3
vladimirausMR is open, but I would recommend to start
4.0.xfor testing.MR also includes
phpcbffixes.Comment #4
luke_nuke commentedIf you guys can't wait for D10 support, you may also look into another module that covers most of the similar use cases: https://www.drupal.org/project/content_snapshot . It just had a D10 compatible release.
Disclaimer: I'm its author and maintainer.
Comment #5
tobias märz commentedI've got some errors with this fork on Drupal 10 and PHP8.1 and created attached patch.
Comment #8
matroskeenI created a new MR because the first one has some out-of-scope changes and doesn't cover all issues.
It also includes path #5, where PHP 8.1 compatibility issues are resolved. Since Drupal 10 requires 8.1, this is required to be committed.
Comment #9
matroskeenHere is a patch that contains MR changes.
Comment #10
ericvl@Matroskeen,
First of all, thanks for the patch in #9 but I've checked the patch and find that the function "denormalize" in the file "src/Normalizer/FileEntityNormalizer.php" should also have a returnvalue of "mixed" in stead of "array|string|int|float|bool|\ArrayObject|NULL".
Just like in all other denormalize functions in the other files.
Can you confirm this and eventually create a new patch, please?
Thanks
Comment #11
izus commentedHi,
preparing for D10 migration, i needed to be compatible d10 while still in D9
Applying #9 patch for Drupal9 and running drush updb caused the following errors
PHP Fatal error: Declaration of Drupal\content_sync\Normalizer\ContentEntityNormalizer::supportsNormalization($data, ?string $format = null, array $context = []): bool must be compatible with Drupal\serialization\Normalizer\NormalizerBase::supportsNormalization($data, $format = null) inweb\modules\contrib\content_sync\src\Normalizer\ContentEntityNormalizer.php on line 105
Fatal error: Declaration of Drupal\content_sync\Normalizer\ContentEntityNormalizer::supportsDenormalization($data, string $type, ?string $format = null, array $context = []): bool must be compatible with Drupal\serialization\Normalizer\NormalizerBase::supportsDenormalization($data, $type, $format = null) in web\modules\contrib\content_sync\src\Normalizer\ContentEntityNormalizer.php on line 113
Fatal error: Declaration of Drupal\content_sync\Encoder\YamlEncoder::encode(mixed $data, string $format, array $context = []): string must be compatible with Symfony\Component\Serializer\Encoder\EncoderInterface::encode($data, $format, array $context = []) inweb\modules\contrib\content_sync\src\Encoder\YamlEncoder.php on line 42
[warning] Drush command terminated abnormally.
I managed to fix them in the following patch so that i can still in drupal 9 while using the patch in #9
this is useless for people that are using D10 but i share it for people in my case (need to prepare D10 compatibility and still on D9)
Hopefully it helps
Comment #12
izus commentedhi,
here is a d10 compatible patch from last dev branch
Comment #13
izus commentedhad a double syncContent declaration, now corrected
Comment #14
izus commentedmissed with syncContent
now ok
Comment #15
izus commentedhad some php deprecation warning corrected
Comment #16
izus commenteddrush command had php warnings
corrected too.
Comment #17
izus commentedsome methods signatures should be fixed, otherwise drush complains about it
Comment #18
blanca.esqueda commentedI'll be doing some testing today, thanks for the patch!
Comment #19
qzmenkoFatal error during enabling module using patch #17:
Comment #20
sylvain lavielle commentedI had the same problem described in #17.
It looks to me the last reliable patch is the #9 one.
The #10 point is to be fixed too. I had an exception syncing files that is related to this point :
The error stands in the ./src/Normalizer/FileEntityNormalizer.php class al L.74 where you have to add a return type this way in order to be working :
public function denormalize($data, $class, $format = NULL, array $serializer_context = array()): array|string|int|float|bool|\ArrayObject|\Drupal\file\Entity\File|NULL... Or define return type as "mixed"
I guess whether a function return a so mixed and incredible bunch of types we should be entitled to use "mixed" as a return type (no, no, this isn't a sarcasm :) ) as suggested in #10
Comment #21
nikolaatI am migrating to D10 and I have to handle multiple modules, before the actual upgrade of the core.
Here is a patch based on status_upgrade checks and previous patches here.
It is for 3.0.0-beta1 version.
It is possible to have additional work when the upgrade to D10 is done.
Comment #22
nikolaatComment #23
supriyak commentedI am migrating some sites from D9 to D10 for that I need to make content_sync compatible with D10.
I tried to apply #9, #20 and #22 patches in my code, but can not make it success. So, creating another one.
Here is a patch based on status_upgrade checks and previous patches here.
It is for 3.0.0-beta1 version.
Comment #24
java008 commentedChanging the return type of normalize() method from the previous patch to make it D10 compatible.
Comment #25
java008 commentedUpdated the previous patch with arguments.
Comment #28
zarexogre commentedHow far off is a drupal 10 version of this module, happy to contribute if more work needed. Thanks
Comment #29
orkutmuratyilmazAny updates on this?
Comment #30
alexbaron77one up , do someone can merge the patch ?
Comment #31
zarexogre commentedI tried the fork 3330173-drupal-10-compatibility-new and on content import via ui got this error so we are not there yet.
An AJAX HTTP error occurred.
HTTP Result Code: 500
Debugging information follows.
Path: /batch?id=1&op=do_nojs&op=do
StatusText: Internal Server Error
ResponseText: The website encountered an unexpected error. Try again later.TypeError: Drupal\content_sync\Normalizer\FileEntityNormalizer::denormalize(): Return value must be of type ArrayObject|array|string|int|float|bool|null, Drupal\file\Entity\File returned in Drupal\content_sync\Normalizer\FileEntityNormalizer->denormalize() (line 141 of modules/custom/content_sync/src/Normalizer/FileEntityNormalizer.php). Symfony\Component\Serializer\Serializer->denormalize(Array, 'Drupal\file\Entity\File', 'yaml', Array) (Line: 64)
Drupal\content_sync\Importer\ContentImporter->importEntity(Array, Array) (Line: 62)
Drupal\content_sync\Form\ContentSync->syncContent(Array, Array, Array) (Line: 296)
Can we get drupal 10 version working and I will test to confirm, thanks.
Comment #32
ericvl@zarexogre
See also comments #10 and #20 (returnvalue must be mixed)
Function denormalize of FileEntityNormalizer calls denormalize of parent ContentEntityNormalizer and there the retunvalue is mixed too.
Comment #33
tobias märz commentedNew patch for D10 compatibility.
Based on 3.0.0-beta1 version.
Hopefully i integrated everything required, to get a D10 version out.
Comment #34
orkutmuratyilmaz@Tobias März, your patch fails, when try to apply it.
rm LICENSE.txtComment #35
tobias märz commentedHere is a new patch. Now it is applied correctly.
Comment #36
izus commentedpatch #35 worked fine for me
Thanks
Comment #37
orkutmuratyilmazPatch #35 works. The module works with D10 now. Thank you @Tobias März:)
Comment #38
ericvl@Tobias März
Thank you for your great work to make this patch but I have only one remark: this patch is based on an old beta version of Drupal 9. In the mean time, a lot of bugs were solved and modifications were done on the development branch that are not included in your version.
Is it possible to make a patch with your modifications so that the result is Drupal 10 compatible but based on the development branch?
Thank you.
Eric
Comment #39
ericvl@Tobias März
I found that merge reauest !10 is ready and have all modification to be compatible to Drupal 10 and PHP 8.1 AND have the latest bug fixes.
If somebody that is capable to merge, merge this in the 3.0 branch, we could have a 3.0 development branch that is D10 compatible.
The problem is here probably that no one is capable of making a fix. What a pitty...
Anyone out there???
Comment #40
blanca.esqueda commentedI’ll do the merge to branch 3.0
Regards,
Blanca
Comment #41
ericvl@Blanca.Esqueda
Glad you're back.
Be carefull to merge the correct branch. There are a lot of try-outs and you need the correct one. It is merge request !10 in branch 3330173-drupal-10-compatibility-new.
The only 2 thinks that are still to be done before you can make a new release is, I think:
- look at this issue and check the patch in comment #7. With this modification, i'm using it for months now and it fixes the bug.
- changing the module's composer.json file so that it depends on a specific core version. The modifications should be:
It is not good to having no restrictions on the core version.
Both modifications are tested.
Regards,
Eric
Comment #42
tobias märz commented@Blanca.Esqueda
It would be great to get a new version.
Comment #43
ericvl@Blanca.Esqueda
Hello Blanca,
If you don't find the time to make a new D10 compatible version of this great module, could you delegate this work to someone else that can do it. Version 9 of Drupal core doesn't get any security updates anymore now for some months now. So, it is adviced that we upgrade to D10.
Thank you in advance.
Greetings
Eric
Comment #44
zarexogre commentedThere seems like a D10 version of this module but I have tried the patches and the branches to no joy. Could someone possibly cut a new release for the D10 version please. Epic module appreciate all your work. Or explain how to get the version that works with D10 as had some issues with the patches. Thanks
Comment #45
socieboy commentedAny update on this thread?
Comment #46
avpadernoComment #49
mjgruta commentedThe latest MR breaks. We have been using this URL as patch: https://git.drupalcode.org/project/content_sync/-/merge_requests/10.diff
[Drupal\Core\Extension\InfoParserException]
Unable to parse modules/contrib/content_sync/content_sync.info.yml yaml_par
se(): scanning error encountered during parsing: could not find expected ':
' (line 8, column 1), context while scanning a simple key (line 7, column 1
)
Comment #50
orkutmuratyilmazI've downloaded the 3.0.x-dev release, applied @mjgruta's latest MR (as a patch) and changed the content_sync.info.yml file like below:
And activated the module.
It works nice with Drupal 10.3.0-rc1, PHP 8.3.8 and PostgreSQL 16.1 :
Thank you for everything.
Comment #51
orkutmuratyilmazIf I change the
content_sync.info.ymlas below, upgrade status report says that, it is compatible with D11 too.Please publish the dev release with this changes:) I'm excited to put this in to my CI/CD flows:)
Comment #52
avpadernoTruly, this issue aims to add compatibility only with Drupal 10.
Comment #53
orkutmuratyilmaz@apaderno, you're right. Thanks for correcting.
Comment #54
leeksoup commentedI'm also hoping for this functionality with D10 compatibility and wondered about the status. Is it planned soon, or should I try as #50?
Comment #55
leeksoup commentedUpdate. I tried the method described by @orkut-murat-yılmaz in #50 but it does not work for me. I get error messages on both cli and GUI attempts to install or uninstall, and nothing for the module appears in my admin/config page under Development (or anywhere).
@orkut-murat-yılmaz - when you said "@mjgruta's latest MR (as a patch)" did you mean e0ef7263 - Update content_sync.info.yml, invalid indentation? That is the one I applied...
I am using Drupal 10.3.2, PHP 8.2.18, MySQL 5.7.23.
Error messages:
GUI install from admin/modules page gives a "This website encountered an unexpected error."
But if I try drush again, then it says it was already installed...
Yet, nothing is added to admin pages.
And if I try to uninstall, I get this error:
Yet, GUI shows it in Uninstall page. Though trying to uninstall again gets "The website encountered an unexpected error. Try again later." error.
Trying again did work though, contrary to what drush reports.
Help?
This module looks like just what I need right now ... if only I could get it to work. Thanks.
Comment #56
guido_sThe last information I have from @Blanca.Esqueda is that she already wanted to do a d10 release about a month ago and that she is waiting for some features some other developers are currently working on.
As I didn't get any replies on new messages, I don't know what the current status is.
But my colleague informed me about another module single_content_sync which already has a d10 release and provided everything we needed for our use case.
Maybe this might help some of you which are in need of content sync features for d10. It doesn't support commerce products out of the box though and some other more special field types. But it can be extended.
Comment #57
leeksoup commented@guido_s - Thank you for the update. I hope it will happen soon! Meanwhile, also thanks for the info on single_content_sync. I will give it a try.
Comment #58
vladimirausSeems to me that maintainers are not interested in doing the release.
I contacted them more that a year a ago and the response was exactly the same. 🤖
I'd recommend to people still using it creating a fork for D10 and D11+ support.
Comment #59
leeksoup commented@guido_s = Thank you for the alternative suggestion. The Single Content Sync module works great for my use case!
@vladimiraus - Noted, thanks.
Comment #61
blanca.esqueda commentedClosing this task as the code has been merged to 3.0.x-dev
Thanks: izus, vladimiraus, NikolaAt, tobias märz, matroskeen, avpaderno, java008, sylvain lavielle, supriyak, sahal_va, mjgruta, orkut murat yılmaz, ericvl, leeksoup, zarexogre, Luke_Nuke, guido_s, socieboy, qzmenko, alexandre.baron@symetris.com