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

undefined method PhpOffice\PhpSpreadsheet\Calculation\Calculation::_getMatrixDimensions() #340

Closed
thezombieguy opened this issue Jan 18, 2018 · 1 comment

Comments

@thezombieguy
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)

This is my first bug report. Please go easy on me if i screw it up. :)

What is the expected behavior?

Whenh loading spreadsheet active sheet using the toArray(null, true, true, true) method with a formula like so: =A2&"001"&TEXT(ROWS($D$2:D2),"000") it should load all the cells into an array as expected.

What is the current behavior?

Doing this generates an error:

Fatal error: Uncaught Error: Call to undefined method PhpOffice\PhpSpreadsheet\Calculation\Calculation::_getMatrixDimensions() in
/public_html/dev/phpexcel/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef.php:229
Stack trace:
#0 [internal function]: PhpOffice\PhpSpreadsheet\Calculation\LookupRef::ROWS(Array)
#1
/public_html/dev/phpexcel/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Calculation.php(3749): call_user_func_array(Array, Array)
#2
/public_html/dev/phpexcel/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Calculation.php(2729): PhpOffice\PhpSpreadsheet\Calculation\Calculation->processTokenStack(Array, 'D2', Object(PhpOffice\PhpSpreadsheet\Cell\Cell))
#3 /public_html/dev/phpexcel/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Calculation.php(2526): PhpOffice\PhpSpreadsheet\Calculation\Calculation->_calcul

On line 2791 of Calculation.php is the following:

public static function getMatrixDimensions(&$matrix)

but Lookup.php is trying to call

Calculation::_getMatrixDimensions($cellAddress); 

which is an undefined method. See line 148 and 229 of Lookup.php

What are the steps to reproduce?

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:

You need an excel file with a formula similar to the one above to generate the error.

Project Name Value UniqueID
DCM Bob 12 DCM_001_001

Where Unique ID is the formula inserted under UniqueID to generate the value.

test2

<?php

require __DIR__ . '/vendor/autoload.php';

// Create new Spreadsheet object
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();

$reader = new \PhpOffice\PhpSpreadsheet\Reader\Xlsx();
$spreadsheet = $reader->load('/path/to/your/excel/file.xlsx');


$sheetData = $spreadsheet->getActiveSheet()->toArray(null, true, true, true);

Which versions of PhpSpreadsheet and PHP are affected?

1.0

@PowerKiKi
Copy link
Member

Duplicate of #336

@PowerKiKi PowerKiKi marked this as a duplicate of #336 Jan 18, 2018
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

2 participants