-
-
Notifications
You must be signed in to change notification settings - Fork 189
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
ObjectAccess behaviour broken on ArrayObject #2041
Comments
I somewhat disagree with this being a bug, because we make no promises as of the quality of gettableProperties. Those are clearly the gettableProperties of this object. |
…ePropertyNames() This changes the `ObjectAccess.getGettablePropertyNames()` method to only return "array properties", i.e. the contents of the internal storage, but no longer e.g. `arrayCopy` or `iterator`. Fixes neos#2041
Well… I think it is really unexpected behaviour. |
It does what it says on the "tin":
It's a rather low level utility function that is intentionally simple in what it does, I think adding exceptions on this level is rather not a good idea, because that could lead to unintentional behaviour (as well). I would rather want to think about how we use it and if that's maybe wrong, if we come to the conclusion that this is the right place, sure, but at the moment I am not really convinced it is. Apart from the change being breaking if your code relies on the existing behaviour. |
I would also expect But changing this core behavior would probably break quite a lot of code in a very unpleasant way |
I'm a bit undecided tbh. I would wish Iff we fully agree on that, let's fix it in a way that will not blow up too many things - possibly means target master only, which in turn means different behaviour between supported versions that needs to be documented. |
I came across this in the contect of mapping CR nodes, and the For my particular code I did add a |
We could just add a dedicated |
That sounds plausible, but |
Ping… bringing this up again. If we decide to fix it in some breaking way, it could just make it for 8.0. If not, should I add a new converter instead? Would be 8.0, too, but non-breaking. |
I'm somehow still in favor of a new converter. |
…ePropertyNames() This changes the `ObjectAccess.getGettablePropertyNames()` method to only return "array properties", i.e. the contents of the internal storage, but no longer e.g. `arrayCopy` or `iterator`. Fixes neos#2041
This adds an ArrayObjectConverter that allows to convert to a plain array. It uses `getArrayCopy()` to get the job done. Fixes neos#2041
This adds an ArrayObjectConverter that allows to convert to a plain array. It uses `getArrayCopy()` to get the job done. Fixes neos#2041
Description
When using
getGettablePropertyNames()
on anArrayObject
, the returned result includes not only the "real" properties of the object, but also internalArrayObject
properties. This affectsgetGettableProperties()
, too.Steps to Reproduce
Expected behavior
Actual behavior
Affected Versions
Flow: since ages ago…
The text was updated successfully, but these errors were encountered: