⚠ 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

BUG in using OR operator in string based where condition Grocery CRUD Enterprise 2.5.7



larasmith

larasmith
  • profile picture
  • Member

Posted 30 June 2018 - 03:32 AM

So I'm in a situation wherein I need to use an OR operator to obtain needed results.

From the documentation of Where in https://www.grocerycrud.com/enterprise/api-and-function-list/where-3, I tried using the string input by:

			$crud->where([
			    'table.data_UId = 2 OR '.
			    'table.data_Shared = 1'
			]);

Yes, the crud rendered successfully but during the press of Edit or Delete button an error message displays:

 

Something Went Wrong!

Either the user doesn't have access to this row, either the row doesn't exist.

 

How can I prevent this error from happening? I really need the "OR" operator for this situation though. Is there any workaround?

 

Thanks in advance!

 

 

 


larasmith

larasmith
  • profile picture
  • Member

Posted 01 July 2018 - 23:31 PM

Up for this issue this week...


larasmith

larasmith
  • profile picture
  • Member

Posted 11 July 2018 - 03:26 AM

I solved this one using custom model...

 

See: /topic/4349-custom-model-ruins-the-filtering-of-set-relation-data/