I'm trying to install a module named views_data_export. While installing I get the error that csv_serialization can't install because it requires league/csv:^7.1.
League/csv is already installed but with a newer version (8.2). Could the requirement be updated to use the newer version so I don't have to downgrade league/csv?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

yassin.barrani created an issue. See original summary.

RoSk0’s picture

Version: 8.x-1.0 » 8.x-1.x-dev

Yeah, this is not good. Version 8 of League\Csv was release 2015-12-11 and should be used instead.

ndf’s picture

Status: Active » Needs review

Can you try --with-dependencies when running composer?

Like
composer update drupal/csv_serialization --with-dependencies
composer update drupal/views_data_export --with-dependencies

That way, composer will also update the latest league/csv that fits ^7.1
https://blog.madewithlove.be/post/tilde-and-caret-constraints/
https://www.jeffgeerling.com/blog/2017/tips-managing-drupal-8-projects-c...

RoSk0’s picture

Status: Needs review » Active

Hi @ndf,

The point of this story is to switch to most recent version which is 8.x current version restriction is ^7.1 which is not going to allow composer to use any 8 version.

borisson_’s picture

@ndf, the advice of @R0sk0 is right here, can we update to version 8.x of the league package or are there big api-changes we need to worry about?

ndf’s picture

@borisson_
So views_data_export and csv_serialization need a different version of League\Csv

I was too fast with my conclusion (happens sometimes). Therefor: #3 not good :|

The League\Csv 7 and 8 do have some big api-changes. I don't know if we it can be simply upgraded.
Version 7 is unsupported now (http://csv.thephpleague.com/). So I think that csv_serialization must upgrade to 8.

Link with changes: http://csv.thephpleague.com/upgrading/8.0/

anfor’s picture

Hi,

Looking to the upgrading path, I don't see much changes regarding csv_serialization.

To test I manually updated league/csv from github release 8.2.1 (https://github.com/thephpleague/csv/releases/tag/8.2.1)

colan’s picture

Status: Active » Needs review
acbramley’s picture

views_data_export now depends on the csv_serialization module so the dependencies should not conflict. In fact, the Drupal 8 version always has so I'm not sure how you had version conflicts in the first place.

However, league/csv now has a new major version of 9 but this requires PHP 7 or higher so I'm not sure if we should aim for that.

http://csv.thephpleague.com/9.0/
http://csv.thephpleague.com/upgrading/9.0/

Can we please get automated testing added at https://www.drupal.org/node/2567011/qa so tests run on patches in the queue?

I will test #7 manually, but it would be good to get that committed as running patches on composer does not work when dependencies change.

Thanks!

acbramley’s picture

Small fix to remove the optional param in fetchAssoc as it defaults to 0

acbramley’s picture

I've pushed a fork of the module to a public repo including the patch so I can use the updated library. If anyone else wishes to use it before the patch is committed you just need to

1) Add the following to the repositories key of your composer.json file:

{
    "type": "vcs",
    "url": "https://github.com/acbramley/csv_serialization.git"
}

2) Add "drupal/csv_serialization": "dev-dev-2856321" to your composer requires. (don't ask me why it needs to be dev-dev, I tried a few different things)
3) Run composer update drupal/csv_serialization league/csv

  • grasmash committed a6e3d1a on 8.x-1.x authored by acbramley
    Issue #2856321 by acbramley, anfor, yassin.barrani: Outdated library as...

grasmash credited grasmash.

grasmash’s picture

Status: Needs review » Fixed
acbramley’s picture

@grasmash thanks a lot!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.