-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[BUG] NamedRange issue #1739
Comments
PR #1535 introduced a bugfix which is a breaking change to Named Ranges: IMPORTANT NOTE: This Introduces a BC break in the handling of named ranges. Previously, a named range cell reference of B2 would be treated identically to a named range cell reference of $B2 or B$2 or $B$2 because the calculation engine treated then all as absolute references. These changes "fix" that, so the calculation engine now handles relative references in named ranges correctly. Your definition for "manufacturers" uses relative references, and thus is probably affected. Is the problem resolved if you change your code to: $sheet->getParent()->addNamedRange(new NamedRange('manufacturers', $manufacturers, '$A$1:$A$' . $manufacturers->getHighestRow())); //populator id! |
I can confirm that what @oleibman told, it is working as expected. Be aware of the " and the $ sign, it will process it as a variable. The below snippet is working as it should. $event->sheet->getDelegate()->getParent()->addNamedRange(
new NamedRange(
'manufacturers',
$manufacturers,
'$A$1:$A$' . $manufacturers->getHighestRow()
)
); |
This is:
What is the expected behavior?
To display populated dropdowns
What is the current behavior?
After upgraing to the newest Laravel and packages, I've lost the functionality of addNamedRange, functionality that was used for a long time, until now.
I am generating a sheet for manufacturers that holds all the data for my dropdown list
DataValidation::TYPE_LIST
This is great, and populated with hundreds of manufacturers.
Now with this method, I am referencing that sheet, all the restrictions work, except de data.
$manufacturers
sheet with data.As you can see, the restrictions are there, but the data fails to populate the dropdown, but the sheet with data is there.
Proof, that the manufacturers sheet is populated, commented out
![image](https://user-images.githubusercontent.com/5064872/100877479-816a1180-34b1-11eb-8c61-beed405450d7.png)
Worksheet::SHEETSTATE_VERYHIDDEN
If I added the validation formula by referencing manually the sheet, it does work.
Which versions of PhpSpreadsheet and PHP are affected?
1.15.0 - 2020-10-11
The text was updated successfully, but these errors were encountered: