-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
Undefined property: App\Invoice\Entity\Inv Cycle ORM Proxy::$id #140
Comments
Thanks for report 👍 |
No probs Vijk. Keep up the hard development work. You are making amazing contributions to the Php community. |
@rossaddison I updated package, can you try now? |
Ok just seen your message. Will try. |
No change unfortunately. It would be great if I could insert a 'property' annotation in the 'model' or use a getter or setter in the model to reflect the integer property of the id as in Yii2 models but then again the $model variable was previously input into a static function although not passed from the controller. I have never figured out how the previous Yii3 GridView got the $model variable since it was not passed by means of the InvController.php. Injected? Perhaps you could explain how the $model variable was passed previously just as a matter of interest and unrelated to the issue here. ....previous Yii3 GridView using DataColumn
It is not a problem getting the DataColumns into the VarDumper::dump by means of the following code:
[ I think the problem is that the code is trying to iterate over an array that contains different levels of relational data with Cycle property types but I think the problem is that a $model is needed to instantiate properties. Just my opinion. The $array value still keeps the cycle properties eg. deeper down the array. Could a model be introduced which can replace mitigate these values perhaps? Ok just tested the $model variable with other $variable names and it is a local static function input parameter that is unrelated to $model global value which explains why it cannot be passed from the Contoller. If i substitute $any with $model in
it still gives the same value. So the issue cannot be model related. |
|
Hm. Does entity contain property |
There is nothing in the __construct parameters or the _construct assignments because the id gets created. This has all been Psalm level 1 tested as well. |
I understand. Now But do this cycle entry work with Yii3 GridView before? |
Yes the cycle entity was working with the Yii3 GridView before. |
Hm. It's very strange, because getting of value not changed... |
I have noticed the yiisoft/form has changed and I have static errors. I am going to fix these first and test. I will get back to you. |
Oh. Seems, I understand. Instead of this code: DataColumn::create()
->attribute('id')
->label($s->trans('id'))
->value(static fn(object $any) => $any->getId()), Try it: new DataColumn(
'id',
header: $s->trans('id'),
content: static fn(object $any) => $any->getId()
); |
Now I am actively working on Yii Form and Yii DataView, changes with break BC are possible :( But I hope, result will be good. |
What steps will reproduce the problem? Testing
What is the expected result? Smooth run
What do you get instead? Error
Additional info
..resources/view/invoice/inv/index.php
Hi Vijk,
If I pass an empty array for $columns, the GridView attempts to build the ActionColumns ie. view etc and I get the following error as well:
I thought this might be of interest. The code appears not to be accepting the DataColumn's first argument id because it has no property type associated with it ie. undefined property. This appears to be a Cycle issue.
The text was updated successfully, but these errors were encountered: