Hello,
Just to let you know that using multiple fields with setRelation as the following doesn't work with 2.6.11 :
$crud->setRelation('admin_id', 'users', '{id} - {first_name} {last_name}');
Error given in AJAX request :
Warning: strstr() expects parameter 1 to be string, array given in : \vendor/grocerycrud/enterprise/src/GroceryCrud/Core/State/StateAbstract.php (line 954)
Problem is an array is given to strstr. This array contains :
- id
- first_name
- last_name
My workaround was to add this at before the return in the function hasMultipleFields :
if(is_array($titleField)) $titleField = implode($titleField);
Please let me know if you don't want me to publish the name of your functions like I just did. I did it in order to help you maintain your plugin because I love it and want to help !
Best regards