Problem/Motivation
I have a view of Orders and every time i hit this page the error log is being flooded with this error:
Warning: Undefined property: Drupal\views\ResultRow::$order_id in Drupal\views_bulk_operations\Service\ViewsBulkOperationsViewData->getViewEntityData()
Looking at the code i can see getViewEntityData() method is trying to pull the $row->{base_field} value from the views row result object. In my view of Orders, $base_field is "order_id", but in my row object i have only an entry for order_id_1.
I looked at the built in Carts view that comes with Commerce (after switching it from core bulk actions to vbo) and it does have a row result entry of order_id. Unclear why my view has order_id_1. I don't see anything obvious in the view that would explain this; but as it isn't an issue either for my view or my view when using core bulk actions, i suspect this is a bug in VBO. It likely needs to be more forgiving or find a different way to line up base field with the entry in the view row object.
Certainly not the correct fix, but for now, i am just doing a vbo hack patch to strip out any _\d that might be there.. just to stop flooding my logs.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3548294-getviewsentitydata-incompatbile-2.patch | 1.15 KB | liquidcms |
Comments
Comment #2
liquidcms commentedactually this may be a real bug and my patch might be correct. i think it is possible depending on the views query that the base field entry in the row result is not indexed by the base field. the attach patch handles those cases.