⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Error in clicking View button in setRelation with Where Condition and setPrimaryKey



larasmith
  • profile picture
  • Member

Posted 11 July 2018 - 08:43 AM

Dear @web-johnny 

 

I created a setRelation with Where condition. It works properly and displays the needed data but when I click the view button it throws an error. Refer to the image below:

Either_the_user_doesn_t_have_access.png

 

This is the code:

	$crud->setPrimaryKey('gsm_FlId', 'gsm');
	$crud->setRelation('midrep_FLId', 'gsm', '{gsm_Section} ~ {gsm_Course}', ['gsm.gsm_UserId' => $_SESSION('user_ID')]);

Is it a bug? Is there a fix or any workaround for it?

 

Please help. Thanks!


larasmith
  • profile picture
  • Member

Posted 12 July 2018 - 03:40 AM

Dear @web-johnny 

 

Another update in this issue... I tried it in another module that I was developing and the Edit throws the same error as well.  :(  :(  :(

 

I observed that it works once the where condition in the setRelation was removed. But in my situation the where condition is critical for filtering specific data.
 
I hope this bug gets fixed soon.
 
Thanks!
Lara