-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
Closed
Copy link
Description
This is:
- [x] a bug report
- [ ] a feature request
- [ ] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpspreadsheet or https://gitter.im/PHPOffice/PhpSpreadsheet)
What is the expected behavior?
Load the data validations that references lists of another sheet.
What is the current behavior?
return data validations with none type. Data not loaded for external list.
This regression was reported in early 2018. Never merged.
Excel sample:
sample.xlsx
What are the steps to reproduce?
Create a xlsx file with a column with data validation that reference a list of another sheet, then load it in your code.
Please provide a Minimal, Complete, and Verifiable example of code that exhibits the issue without relying on an external Excel file or a web server:
<?php
require __DIR__ . '/vendor/autoload.php';
// Create new Reader and Spreadsheet object
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader('Xlsx');
$spreadsheet = $reader->load('sample.xlsx');
// add code that show the issue here...
$spreadsheet->setActiveSheetIndexByName('Feuil1');
$worksheet = $spreadsheet->getActiveSheet();
// internal drop down list: success (type "list")
echo 'B5:DrowDownListType: ', $worksheet->getCell('B5')->getDataValidation()->getType(), "\n";
// external drop down list: failure, data not loaded (type "none" instead of "list")
echo 'B14:DrowDownListType: ', $worksheet->getCell('B14')->getDataValidation()->getType(), "\n";
Which versions of PhpSpreadsheet and PHP are affected?
phpspreadsheet >= 1.6.0
php >= 7.2
Metadata
Metadata
Assignees
Labels
No labels