Jump to content


Member Since 11 Jan 2019
Offline Last Active Mar 28 2019 07:20 PM

#148932 Entreprise : Issue found with setRelation and bracets (solution found)

Posted NadimD on 14 January 2019 - 03:03 AM

Greetings !


If you are using Entreprise Edition, it will be in the file :

vendor/grocerycrud/enterprise/src/GroceryCrud/Core/State/StateAbstract.php at line 953

Under the function hasMultipleFields .


I'm also working on a patch to allow you to search related data if you use custom fields with brackets {} (multiple brackets too).


Since you're an active user, could you tell me if we are allowed to modify the code and share solutions ? I'm really want to improve the plugin and add more patches!


Also feel free to tell me if you discover a glitch after applying any of my patches, that would help me to improve them.

You'll find more info about the patch I'm working on here : https://www.groceryc...model/?p=148930

Might interested you !

#148928 Bugs in Displaying setRelation Field when Showing More Than One Field in v.2....

Posted NadimD on 12 January 2019 - 09:44 PM

Hello larasmith,


I'm new here and can't answer for the staff, I'm not a pro, but I'm willing to help you.


You could try to follow what I did here in 2.6.11 :

=> https://www.groceryc...solution-found/


Your problem might not be the same, so non-related, but since it's about brackets and fields, I think why not, you can always go back!

Also, could you try removing the brackets, just to see what happens, like this :

$crud->setRelation('vdr_Course', 'set_course', '{course_Title} {course_RefNo}');

Try again and leave only {course_RefNo}


Does that affect the display ? Is yes, you can try to use a callback, but you have to have the related field identifiable in order to make a callback on it:



Set a callback on your column, get both course_Title and course_RefNo in your callback. Use the example provided in the link !