-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Consequetive "=" in a value passed taken as datatype FORMULA which throws an error. #1310
Comments
jaiminmoslake7020
added a commit
to jaiminmoslake7020/PhpSpreadsheet
that referenced
this issue
Jan 10, 2020
…ORMULA which throws an error.
3 tasks
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
oleibman
added a commit
to oleibman/PhpSpreadsheet
that referenced
this issue
Jun 26, 2024
Fix PHPOffice#1310, which was closed as stale in 2020, but which I will now reopen. Supersedes PR PHPOffice#1311 (@jaiminmoslake7020), from which I will remove the stale label but leave closed. The issue and the PR were too limited - they detected that the use of two equal signs at the start of a string made for an invalid formula, but there are variations, trivial and otherwise, which might also be detected. Using `setValue` with a string which starts with an equal sign will now attempt to parse (not evaluate) the formula; for certain situations in which the parser throws an exception, the string will be treated as a string rather than a formula. An example where it will still be treated as a formula is a 3D range reference, where the problem is not that it can't be parsed, but rather that the formula isn't supported (see unit test Calculation/Engine/RangeTest::test3dRangeEvaluation). Allowing such a formula might cause problems later on, but that is already what happens. A string beginning with an equal sign but which isn't treated as a formula will automatically set the `quotePrefix` attribute to `true`; all other `setValue` attempts will set it to `false`. This avoids the problem of a lingering value causing problems later on. It has long been a matter of discontent that setting a style can change the selected cells. A new method is added to `Worksheet`: ```php applyStylesFromArray(string $coordinate, array $styleArray) ``` This will attempt to guarantee that the active sheet in the current spreadsheet, and the selected cells in the current worksheet, remain undisturbed after the call. The setting of `quotePrefix` above is the first use of the new method.
11 tasks
Will be fixed by 4073. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is:
What is the expected behavior?
Assume a cell value is "=============".
It considers datatype for this "FORMULA" which is wrong and throws error.
It should consider it as STRING.
version 0.2.9 PHPOffice
src/PhpSpreadsheet/Cell/DefaultValueBinder.php LINE 58
What is the current behavior?
What are the steps to reproduce?
Just pass "===============" as any cell value.
Which versions of PhpSpreadsheet and PHP are affected?
version 0.2.9 PHPOffice
The text was updated successfully, but these errors were encountered: