Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xlsx reader not recognize data validations that references another sheet #991

Closed
nooraldeen-albakri opened this issue May 17, 2019 · 1 comment

Comments

@nooraldeen-albakri
Copy link

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, and empty formula.

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

// when cell with list validate : (=Sheet3!$G$2:$G$4)
var_dump($cell->getDataValidation());
/*
object(PhpOffice\PhpSpreadsheet\Cell\DataValidation)#34559 (13) {
  ["formula1":"PhpOffice\PhpSpreadsheet\Cell\DataValidation":private]=>
  string(0) ""
  ["formula2":"PhpOffice\PhpSpreadsheet\Cell\DataValidation":private]=>
  string(0) ""
  ["type":"PhpOffice\PhpSpreadsheet\Cell\DataValidation":private]=>
  string(4) "none"
  ["errorStyle":"PhpOffice\PhpSpreadsheet\Cell\DataValidation":private]=>
  string(4) "stop"
  ["operator":"PhpOffice\PhpSpreadsheet\Cell\DataValidation":private]=>
  string(7) "between"
  ["allowBlank":"PhpOffice\PhpSpreadsheet\Cell\DataValidation":private]=>
  bool(false)
  ["showDropDown":"PhpOffice\PhpSpreadsheet\Cell\DataValidation":private]=>
  bool(false)
  ["showInputMessage":"PhpOffice\PhpSpreadsheet\Cell\DataValidation":private]=>
  bool(false)
  ["showErrorMessage":"PhpOffice\PhpSpreadsheet\Cell\DataValidation":private]=>
  bool(false)
  ["errorTitle":"PhpOffice\PhpSpreadsheet\Cell\DataValidation":private]=>
  string(0) ""
  ["error":"PhpOffice\PhpSpreadsheet\Cell\DataValidation":private]=>
  string(0) ""
  ["promptTitle":"PhpOffice\PhpSpreadsheet\Cell\DataValidation":private]=>
  string(0) ""
  ["prompt":"PhpOffice\PhpSpreadsheet\Cell\DataValidation":private]=>
  string(0) ""
}
*/

Which versions of PhpSpreadsheet and PHP are affected?

phpspreadsheet - 1.6.0
php - 7.2

@nooraldeen-albakri
Copy link
Author

nooraldeen-albakri commented May 17, 2019

Solution found:
#388 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant