Problem/Motivation

There is currently no release of this module that is compatibel with both 9 and 10. This complicates update procedures; the recommended way to get a site updated from 9 to 10 is to get as much code updated to 10 compatible before updating core itself. With the current situation, you need to run version 2.1 on 9, and for 10 you need to move to version 3.

Proposed resolution

I see that the latest code in the 8.x-2.x branch is marked as D10 compatible, so possibly an 8.x-2.2 release might already alleviate this problem.

Remaining tasks

  • Create a release (?)

User interface changes

None.

API changes

None.

Data model changes

None.

Comments

eelkeblok created an issue. See original summary.

markdorison’s picture

Status: Active » Closed (works as designed)

@eelkeblok We have not found a straightforward way to support both versions due to a breaking change in EncoderInterface::encode() between Symfony 4.4 (D9) and Symfony 6.2 (D10). #3344110: CsvEncoder::encode must be compatible with Symfony\Component\Serializer\Encoder\EncoderInterface::encode

This complicates update procedures; the recommended way to get a site updated from Drupal 9 to Drupal 10 is to get as much code updated to Drupal 10 compatible before updating Drupal core itself.

This is accurate, but in some cases like this one, the module needs to be updated at the same time as core itself.

I see that the latest code in the 8.x-2.x branch is marked as D10 compatible

Thanks for catching this, we should actually go back and mark 2.x as not compatible with D10. #3354899: 8.x-2.x-dev is incorrectly marked as supporting D10

eelkeblok’s picture

Issue summary: View changes

Ah, OK, thanks for the feedback. I guess it would be good to document this in the release notes for 3.0 then.

attheshow’s picture

This is definitely confusing having no code branch that works for both D9 and D10. Trying to figure out how update this in our Intercept project (https://drupal.org/project/intercept) which currently has this module as a dependency since we're going to be dealing with multiple sites for different organizations that could either be on D9 OR D10 as they all make the transition...

markdorison’s picture

@attheshow I believe you could allow either ^2.0 || ^3.0 in Intercept's version requirements and then Composer will select the right version based on the version of Drupal core.

attheshow’s picture

Oh, interesting. I wasn't aware you could use "ors" like that in the composer requirements. I'll try that. Thanks!

hockey2112’s picture

@markdorison, I am using this command to try to allow either version:

composer require drupal/csv_serialization:^2.0 || ^3.0

However, I am receiving the "Nothing to install or update" message and my composer.json remains like this:

"require": {
"drupal/csv_serialization": "^2.0",

Can I manually edit that to look like this?

"require": {
"drupal/csv_serialization": "^2.0 || ^3.0",

Or is there somewhere else I can/should do so?

markdorison’s picture

However, I am receiving the "Nothing to install or update" message and my composer.json remains like this:

@hockey2112 I am not surprised by the "Nothing to install or update" but I am surprised that composer.json did not change.

Can I manually edit that to look like this?

Unsure. If you do that, and then run composer validate, does it report everything as OK? If so, then you should be good to go. If not, then try running composer update --lock and see how that turns out.

hockey2112’s picture

I was in a time crunch situation, so I ended up uninstalling the module.