- Issue created by @markdorison
- 🇺🇸United States markdorison
Conversation in Drupal Slack seems to confirm that dropping D9 support from the 3.x branch is the way to go.
These are one of the few times a major version bump is needed in contrib, and it's hard. Simple Oauth had same problem
yes, all the serializer stuff has been a quite painful. as there already is a 3.x release, it probably makes sense to just make that d10+
- @markdorison opened merge request.
- Status changed to Needs review
over 1 year ago 11:55pm 23 February 2023 -
markdorison →
committed f9083374 on 3.x
Issue #3344110 by markdorison: CsvEncoder::encode must be compatible...
-
markdorison →
committed f9083374 on 3.x
- Status changed to Fixed
over 1 year ago 12:01am 24 February 2023 Automatically closed - issue fixed for 2 weeks with no activity.
- Status changed to Fixed
over 1 year ago 3:20pm 13 March 2023 - 🇷🇴Romania Andras_Szilagyi
In symfony 6.2 the signature is:
public function encode(mixed $data, string $format, array $context = []): string
while in csv_serialization the signature:
public function encode($data, string $format, array $context = []):string
shouldn't we fix this?
- 🇺🇸United States markdorison
@Andras If you'd like to create a new issue with an MR for that change, I would be happy to review.
This not being in the 3.x release causes WSOD on Drupal 9 installations.
Fatal error: Declaration of Drupal\csv_serialization\Encoder\CsvEncoder::encode($data, string $format, array $context = []): string must be compatible with Symfony\Component\Serializer\Encoder\EncoderInterface::encode($data, $format, array $context = []) in /var/www/html/web/modules/contrib/csv_serialization/src/Encoder/CsvEncoder.php on line 125
- 🇺🇸United States markdorison
@tonytheferg: That beta release must incorrectly declared support for Drupal 9. If you run
composer require drupal/csv_serialization:^2.0 || ^3.0
is that beta release still installed?Version 3.0 is not compatible with Drupal 9. It is not possible to support both Drupal 9.x and 10.x in a single release 🐛 CsvEncoder::encode must be compatible with Symfony\Component\Serializer\Encoder\EncoderInterface::encode Fixed of this module due to a breaking change in
EncoderInterface::encode()
between Symfony 4.4 (D9) and Symfony 6.2 (D10). When preparing for an upgrade to Drupal 10 we recommend that you widen your Composer version constraints to allow either 2.x or 3.x:composer require drupal/csv_serialization:^2.0 || ^3.0
. This will allow the module to be automatically upgraded when you upgrade Drupal core. - 🇨🇦Canada bcdev
I was getting issues upgrading this module to 3.0 when using a D9 install (currently moving to D10 but needed to upgrade this first). I was seeing the same error when running a drush updatedb:
Unable to decode output into JSON: Syntax error Fatal error: Declaration of Drupal\csv_serialization\Encoder\CsvEncoder::encode($data, string $format, array $context = []): string must be compatible with Symfony\Component\Serializer\Encoder\EncoderInterface::encode($data, $format, array $context = []) in /var/www/html/web/modules/composer/csv_serialization/src/Encoder/CsvEncoder.php on line 125
Using the
composer require drupal/csv_serialization:^2.0 || ^3.0
command allowed me to get past this and I'm assuming that this will work for D10 also once I start that upgrade process. - 🇫🇷France aiphes
Hello
Thanks @bcdev, applied your tips and seem to be ok now. - 🇺🇸United States bwoods
Just a followup for #15 – you will want to include
^2.0 || ^3.0
directly in your composer file. Running the listed command will just require 2.0, since composer sees the pipes as a new command. - 🇺🇸United States texas-bronius
Echoing @bwoods in #18 the instructions given in https://www.drupal.org/project/upgrade_status → read:
composer require drupal/csv_serialization:^2.0 || ^3.0
whereas actually we need the quotes like:
composer require 'drupal/csv_serialization:^2.0 || ^3.0'
or composer.json will not be updated as you'd expect.
Further, if you're already on 2.1, you shouldn't specify just 2.0 but^2.1 || ^3.0
I think. Maybe the best move is less specific, since we don't yet _know_ what the 3.x version will be at the time of finally pulling the trigger:^2.1 || ^3
. Is this message dictated by this module or something else? - 🇺🇸United States markdorison
composer require 'drupal/csv_serialization:^2.0 || ^3.0'
Needing to wrap quotes around the module and version probably depends on what shell you are running but the quotes should provide extra safety. Thank you for noting it!
Further, if you're already on 2.1, you shouldn't specify just 2.0 but ^2.1 || ^3.0 I think.
It shouldn't matter. The caret allows all non-breaking (non-major) releases so specifying
^2.0
will allow2.1
and should not downgrade you. That said, feel free to specify2.1
, if you are already on at least2.1
there is no harm in it!Maybe the best move is less specific, since we don't yet _know_ what the 3.x version will be at the time of finally pulling the trigger: ^2.1 || ^3
Specifying
^3.0
or^3
should result in the same compatibility. - 🇫🇷France Nicolas S. Lyon, France
I propose this patch to fix error when drush cr
- 🇺🇸United States dianacastillo Miami
this doesnt work for D10 because the 3xdev doesnt work for d10 and the 4.0 version has the same issue still