Closed ExpandXSoln closed 3 years ago
Any comments on this issue?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@kartik-v Any suggestions on how to resolve this issue? Would be really helpful as this is last piece of conversion is remaining.
What is the value of your primary key
- is it a string or an object?
Hi, I use grid view in following way
GridView::widget([ 'dataProvider' => $dataProvider, 'filterModel'=> $searchModel, ....
]);
Where $dataProvider is populated through the Search model and it returns Object array. I am not sure if that answers your question but hope helps. Also this grid view has editable columns as well.
Issue is coming when I add 'rowOptions', sample code for rowOptions is as given below
'rowOptions' => function($model){ $returnContent =['style'=>'background-color:#12322,color:white','title'=>'Below reorder level']; return $returnContent; },
@kartik-v found the issue, all thanks to you to pointing in the direction to check, actually I have defined $returnStatus=''; and there were bunch of conditions that were populating array to it as given in above comment. When it does not go into any of those conditions, it was trying to return string from row option due to this. I changed the declaration to $returnStatus=[]; and it worked. Unfortunately same code is working in lower versions of PHP without any issue so was assuming it is something related to the PHP8.
Thank you for your prompt reply and direction given. Closing this issue as it is not an issue at all in your plugin :-)
I have converted my project to PHP8, and other than what mentioned in the subject of the issue, everything else seems to be working fine for now with this plugin, can you please let me know what should be changed on this line to make it compatible to PHP8?
THanks Aditya