Page 1 of 1

Error with field entity records in second level

Posted: 30 Jun 2016, 18:20
by miguel_sousa
Hi Sergey,

When I used a entity field to take all records of specifical entity, in the first level it works good, below the screenshot:
Items in first level.PNG
But when I have a Parent and I am in the second level all the records of application shows in my page ..
Items in second level level with parent.PNG


I am always in the same projet for information..
But in second level il presents all records for all projects..

Is possible that shows like the first level?? Only the records concerning the project activated

Thanks
Miguel Sousa

Re: Error with field entity records in second level

Posted: 30 Jun 2016, 21:19
by support
Can you provide screenshot from Application structure and tell me which Entities you try to relate.
I have to understand levels for sub-entities

Re: Error with field entity records in second level

Posted: 01 Jul 2016, 11:45
by miguel_sousa
Hi Sergey,

Below my structure of entities:
Structure of entities application.PNG
So I am inside of "Congrés" then I go to "Billets" or "Interventions" and I have the field type "entities" with "Stands" ..

I can chose all "stands" that are inside of "Congrés" works very well!!

If I go to "Resa_Hotels" sub-entities " Chambres" and I use the same fiels type "entities" with "Stands", we gives me not only the stands inside of "Congrés" but all "stands" of all "congrés"..

You know what I mean?

Thanks
Miguel

Re: Error with field entity records in second level

Posted: 01 Jul 2016, 15:08
by support
Yes, now it's clear and added in plan to fix this issue.

Re: Error with field entity records in second level

Posted: 05 Jul 2016, 14:43
by support
Replace attached file to:
includes\classes\fieldstypes\fieldtype_entity.php

let me know if problem is fixed

Re: Error with field entity records in second level

Posted: 05 Jul 2016, 16:21
by miguel_sousa
Hi Sergey,

I continue with all records of all projects in "Congrès>Resa_Hotel>"Chambres"!!
Items in second level level with parent 2° img.PNG
But you have fixed another issue, when I have field type entity "Imputations" in a sub-entity " Chambres" I have only the records that belongs to a specific entity " Congrès>Resa_Hotels>Chambres>Imputations".. IS OK..
Items in second level with parent.PNG
Structure of entities application 07_05.PNG
Before I have all records ("Congrès>Resa_Hotels>Chambres>Imputations") of all projects inside of my typefield "Entity" in "Chambres"

I hope you understand what i mean..

Thanks
Miguel SOUSA

Re: Error with field entity records in second level

Posted: 05 Jul 2016, 17:16
by support
Yes, I understand and I can say this way is not supported at the moment.

At the moment you have complex Entities tree and if you try link entities from different branches deep we don't know which parent level we have to check. Yes, in page view it's clear:) but in code we have to have some special configuration where we set which parents we have to check, some think like this.

At the moment we check only first parent.

Fore example if we have:
level 0: Projects
-level 1: Tasks

then if we have Entity field it task we will check Projects

but if we have
level 0: Projects
-level 1: Tasks
--lever 2: Job

and if Job have Entity field then we check parent Task but not Project because Tasks is parent for Job and we have Tasks ID in Job record

This is how current core works.

So as suggestion, try to make Entities tree more simple, or use the same level branch to check the same parent.

Re: Error with field entity records in second level

Posted: 05 Jul 2016, 17:35
by miguel_sousa
I understand..

I gone simplify the tree or put the "Jobs" in the first level like that I have parent " Projects" to check..

Thanks for your proposal

Miguel