luyadev / luya

LUYA is a scalable web framework and content management system with the goal to please developers, clients and users alike.
https://luya.io
MIT License
812 stars 207 forks source link

ngRest SelectModel #1833

Closed cringasu-ionut closed 6 years ago

cringasu-ionut commented 6 years ago

What steps will reproduce the problem?

I have a ngRestModel (ex. Activity) with 2 attributes (ex. "_typeid" and "_categoryid") related with another ngRestModel (ex. DictionaryDetail), both fields referencing on DictionaryDetail ID field. In Activity model I have the ngRestAttributeTypes method within I have two different "where" pointing to same DictionaryDetail model. The second "where" doesn't apply, only the first one.

What is the expected result?

In _typeid I expect to see DictionaryDetail rows filtered by the "where" clause. In _categoryid I expect to see DictionaryDetail rows filtered by the "where" clause.

What do you get instead? (A Screenshot can help us a lot!)

In both fields ("_typeid" and "_categoryid") I see the results from the first "where". image

LUYA Check ouput (run this script and post the result: luyacheck.php)

Additional infos

This method causes the problem:

https://github.com/luyadev/luya-module-admin/blob/master/src/ngrest/plugins/SelectModel.php#L112 Q A
LUYA Version
PHP Version
Platform Apache/XAMPP/MAMPP/etc.
Operating system Windows/Linux Server/OSX/etc.
luya-bot commented 6 years ago

Issue moved to https://github.com/luyadev/luya-module-admin/issues/177