Steps to reproduce -
1) Create a view of type 'REST EXport'
2) Set a path (ex- /csv)
3) Under format settings, check option for Force using fields and select 'csv' for accepted request formats
4) On visiting page - /csv , getting followinng fatal error
Fatal error: Class 'League\Csv\Writer' not found in /var/www/cttransit/modules/contrib/csv_serialization/src/Encoder/CsvEncoder.php on line 110

Comments

renukakulkarni created an issue. See original summary.

grasmash’s picture

Have you followed the installation instructions? You need to install the league CSV library, ideally via composer.

alimc29’s picture

I am getting this error, as well, despite having run composer require league/csv from my drupal project.

I am running php 5.6.10, and have confirmed I have mbstring enabled. I have also tried with php 7.0.0, and get the same error.

Is there something else I am missing?

update:
I have resolved my issue by using composer_manager (this client's site is not yet on d8.1), and running composer update drupal/csv_serialization from my drupal docroot (note: I was initially trying to run this via my sites/sitename directory)

grasmash’s picture

Status: Active » Closed (works as designed)
maryedith’s picture

I have just loaded this module into an 8.4.4 site.
Used $composer require drupal/csv_serialization
and got the /league/csv directory ; I am all up to date.

I get the same error:
Fatal error: Class 'League\Csv\Writer' not found in ...../modules/contrib/csv_serialization/src/Encoder/CsvEncoder.php on line 134

Can someone offer suggestions? THanks.

1kenthomas’s picture

@maryedith:

I just had the same issue after an 8.3.x --> 8.4.4 upgrade, reloading with Composer worked for me. File permissions would be the first thing I looked at, after that. Good luck!

justkristin’s picture

I am getting this error only when I am trying to not use an enclosure. Is there no way to get the view to work without an enclosure, and only a delimiter?

shubhangi1995’s picture

I agree with #3, as it solved my problem