Quick Synopsis:
I have 2 modules
Property
| 1:N
----- Image
When viewing Image: ListVIew I want to be able to do 3 things:
1. view the related Property Name
2. Filter/Search by Propety Name
3. Select images by related Property Name for post-processing.
I have overridden the default view with view.list in the Images module.
I put this in vardefs:
RebuildCode:'**_property_property_name' => array( 'name' => '**_property_property_name', 'type' => 'relate', 'source' => 'non-db', 'vname' => 'LBL_**_IMAGE_PROPERTIES_FROM_**_PROPERTY_TITLE', 'save' => true, 'id_name' => '**_imag825droperty_idb', 'link' => '**_imagepas_property_c', 'table' => '**_property', 'module' => '**_Property', 'rname' => 'name', 'unified_search' => true, ),
Symptoms:
1. Studio shows the field but cannot modify layout (the fields pop back into the hidden list after save deploy
2. the field is not populated, capturing the query shows that the property table has not been joined.
Questions:
1. Am I going about this in the right manner? In my mind its either a configuration issue in the vardef or some missing piece in the cache folder.
Other info of note: I would be ok with just search functionality, I tried a subquery in the searchFields:
to no avail, Sugar doesnt pick it up. I tried custom/modules/**/metadata/SearchFields.php and modules/...Code:'property'=> array( 'query_type' => 'default', 'vname' => 'LBL_PROPERTY_SEARCH', 'operator' => 'subquery', 'subquery' => array( 'OR' => 'SELECT a.id FROM **_image a JOIN **_imagepas_property_c b ON ( a.id = b.**_imagb0aes_image_ida ) JOIN **_property c ON ( b.**_imag825droperty_idb = c.id ) WHERE a.deleted =0 AND c.name LIKE', ), 'db_field' => array( 'id', ) ),
side note:
II don't track the state of the cache and if I feel like there are odd things happening I tend to delete the whole project and reload a fresh copy from subversion and rebuild.
Any insight would be appreciated. I've spent 2 days on the issue with no progress.


LinkBack URL
About LinkBacks



Reply With Quote

Bookmarks