This is a follow-up or continuation from #2919537: Class 'PhpOffice\PhpSpreadsheet\Cell' not found when running drush ms, problem still exists even after the patch from that issue. Unfortunately I can not re-open that issue and the patch there is good to have anyway. This error renders the module not useable in this state, so marked critical.
I attached a minimal yml fiel which produces the error, no input file provided because that is only needed for an actual update.
So, the problem:
Minimal yml file attached, put it in your /config/install dir, enable your module, run drush ms and get the following error:
Error: Class 'PhpOffice\PhpSpreadsheet\Cell' not found in Drupal\migrate_spreadsheet\SpreadsheetIterator->getAbsoluteRowIndex() (line 311 of [error]
/var/www/html/web/modules/contrib/migrate_spreadsheet/src/SpreadsheetIterator.php)
#0 /var/www/html/web/modules/contrib/migrate_spreadsheet/src/SpreadsheetIterator.php(70):
Drupal\migrate_spreadsheet\SpreadsheetIterator->getAbsoluteRowIndex()
#1 [internal function]: Drupal\migrate_spreadsheet\SpreadsheetIterator->valid()
#2 /var/www/html/web/core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php(497):
-- I cut out some - I think- some unnecessary further error messages
Error: Class 'PhpOffice\PhpSpreadsheet\Cell' not found in /var/www/html/web/modules/contrib/migrate_spreadsheet/src/SpreadsheetIterator.php on line 311
Looking into myself, but any assistance will be very much appreciated.
Comments
Comment #2
manu manuFollowing the change introduced in #2919537-2: Class 'PhpOffice\PhpSpreadsheet\Cell' not found when running drush ms :
"phpoffice/phpspreadsheet": "^1.0.0-beta",This allows the use of phpspreadsheet 1.0.0-beta2, however this release introduces a number of breaking changes:
https://github.com/PHPOffice/PhpSpreadsheet/blob/1.0.0-beta2/CHANGELOG.md
Until phpspreadsheet becomes stable and migrate_spreadsheet is refactored, the dependency should be set as:
"phpoffice/phpspreadsheet": "1.0.0-beta",Comment #3
manu manuComment #4
firfin commentedNicely spotted @manu !
That is exactly the problem. As a quick fix this patch works as it fixes (pun intended) the dependency.
Opened another issue for updating the module to work with a newer version of phpspreadsheet here #2932815: Breaking updates in phpoffice/phpspreadsheet
Comment #6
claudiu.cristeaCommitted, thank you. Let's focus now on #2932815: Breaking updates in phpoffice/phpspreadsheet.