-
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
Object of class PhpOffice\PhpSpreadsheet\Calculation\Engine\Operands\StructuredReference could not be converted to string when accessing a cell object's getCalculatedValue() #3635
Comments
hey @oleibman as mentionned in our discussion here, I'm currently facing the same issue. I've made a simple reproducer:
using the file token_converted_to_string_error.xlsx Issue is on Calculation.php where a As I mentionned also, adding this to the class StructuredReference, fix the issue:
I think it is pretty much ok to fix it like this as the Thanks again |
Any news about this issue? Im having the same problem, same version, same function :/ |
If you can test against master, you should see that the issue is resolved. The last release was 1.29 on June 14, and the fix was merged in August. I am not sure when the next release is scheduled. |
Thanks for your answer @oleibman. I'm not the "most familiar" guy with Github. I tried to apply "by force" the given solution, without success. The current version still has the problem and despite everything I can do with PhpSpreadsheet, obviously the "important" part is stuck in another spreadsheet due to this error =) Download directly from here, instead of composer, will this fix already be applied? Thank you again |
To retrieve the master version, use the following command:
The fix will be applied in that version. |
This is:
What is the expected behavior?
To get the calculated value from the cell
What is the current behavior?
An exception is thrown:
Object of class PhpOffice\PhpSpreadsheet\Calculation\Engine\Operands\StructuredReference could not be converted to string
What are the steps to reproduce?
We have a formulae on an excel field:
When trying to access this cell and read the calculated value, the exception described above is thrown. However when dumping the cell value all is fine:
The "calculatedValue" property holds the correct value, but as soon as I'm trying to read that property with getCalculatedValue() the exception is thrown.
What features do you think are causing the issue
Does an issue affect all spreadsheet file formats? If not, which formats are affected?
Cannot say, I've tested with xlsx Excel format (latest version)
Which versions of PhpSpreadsheet and PHP are affected?
phpSpreadsheet 1.29.0
PHP 8.1.20
The text was updated successfully, but these errors were encountered: