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

Indirect modification of overloaded property Model_Nestedset::$children has no effect #300

Open
sagikazarmark opened this issue Sep 18, 2013 · 8 comments

Comments

@sagikazarmark
Copy link
Contributor

This error is thrown, when I try to call dump_tree function with as_object set to true.

In this model EAV is set. The problem is that the eav getter does not return by reference, but by value, so the property does not exists. (UPDATE: the getter DOES return by reference, but it is not a reference of the object in case of EAV.)

@sagikazarmark
Copy link
Contributor Author

Possible solution: return _get_eav by reference. I don't know if that has any effect on other things, but solves this one.

@sagikazarmark
Copy link
Contributor Author

No, it is only a partial solution as this way an error will be thrown, that the property does not exists.

@sagikazarmark
Copy link
Contributor Author

I am not sure, I understand what I did, but I am sure that this problem is related to the fact, that _get_eav does not return by reference.

My PHP version is 5.4.9.

Actually, EAV is not working with Nestedsets at all, but also throws this error. Is this the expected functionality? (I mean, is EAV with Nestedsets implemented? should it work?)

@sagikazarmark
Copy link
Contributor Author

Possible solution: $children and the $path values from dump_tree could be stored in an "exclusion" array, so that properties are always returned by reference.

@sagikazarmark
Copy link
Contributor Author

@WanWizard can you help me understand this issue? I am a bit confused now. 😄

@WanWizard
Copy link
Member

Is this still an issue?

As far as I can see, there is nothing in dump_tree() that could interfere with EAV, nothing accesses properties in that method, only Model object references are assigned to a tree structure.

@sagikazarmark
Copy link
Contributor Author

I will check it out.

@WanWizard
Copy link
Member

Any results from this checking?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants