These are chat archives for collectiveaccess/support

25th
May 2016
mrjayviper
@mrjayviper
May 25 2016 03:38
Hi all. I'm trying to delete an element within a container. this element has had data imported into it. When trying to delete the element, I am getting this message "Can't delete item because it has sub-records".
mrjayviper
@mrjayviper
May 25 2016 07:29
please ignore the thing above (can't delete issue). I thought I didn't submit it. my mistake. sorry!
GautierMichelin
@gautiermichelin
May 25 2016 13:38
Hello Stefan and others
just to have a small confirmation, I think I met a bug lately : I have a container materiaux_tech_c ; containing 2 more containers : materiaux_c and techniques_c. Both the last ones have one list field inside : materiaux and techniques.
Normally I should do a $vt_object->get("materiaux_tech_c") to get the values in the display format defined in the metadata. I'd like to have only the value for "materiaux". I've tried a get with "ca_objects.materiaux_tech_c.materiaux" but the answer is blank (and I'm sure I have a value).
Stefan
@stefankeidel
May 25 2016 13:44
That should work -- if all the codes are correct. What kind of field is it and what version are you running?
GautierMichelin
@gautiermichelin
May 25 2016 13:44
if I do $mycaobject->get("ca_objects.materiaux_tech_c"); I get the correct values (for example 10367:11243) ; if I do $mycaobject->get("ca_objects.materiaux_tech_c.materiaux") I have nothing
this is latest master-fix
Stefan
@stefankeidel
May 25 2016 13:45
We have automated tests for most of the get() stuff so I think we would have noticed if something broke
GautierMichelin
@gautiermichelin
May 25 2016 13:45
yes, that's what I think
Stefan
@stefankeidel
May 25 2016 13:45
That being said it's not out of the question some stuff isn't covered
This one still passes and there are a couple of container expressions in there: https://github.com/collectiveaccess/providence/blob/master/tests/testsWithData/get/AttributeGetTest.php
GautierMichelin
@gautiermichelin
May 25 2016 13:47
hum, no list value in this test
Stefan
@stefankeidel
May 25 2016 13:48
Does your list element have an empty label or idno?
GautierMichelin
@gautiermichelin
May 25 2016 13:48
10sec, I clean my very fast and not so clean test script, so I can copy-paste here 6 lines of code...
Stefan
@stefankeidel
May 25 2016 13:49
Actually, there is a list value in that test
the very first assertion
GautierMichelin
@gautiermichelin
May 25 2016 13:49
oups, sorry
yes, ca_objects.date.dc_dates_types
 $o_search = new ObjectSearch();
 $qr_results = $o_search->search("Métope");    

 $count = 1;
 while($qr_results->nextHit()) {
     //$qr_results
     print "Hit ".$count.": ".$qr_results->get('ca_objects.preferred_labels.name')."<br/>\n";
     print "Hit ".$count.": ".$qr_results->get('ca_objects.materiaux_tech_c')."<br/>\n";
     print "Hit ".$count.": ".$qr_results->get('ca_objects.materiaux_tech_c.materiaux')."<br/>\n";
     $count++;
 }
`
this is the code I use, quite really simple
metadata names are ok
I get :
Hit 2: Tirage partiel d'un bloc d'angle: fragment
Hit 2: 14008;13977
Hit 2:
as an answer
GautierMichelin
@gautiermichelin
May 25 2016 13:54
the 14008 is a valid list value for "materiaux"
even if I move away the search, to instantiate a single ca_objects item, I do have the same results
just tested something weirder : if I a simple text metadata in addition of my 2 list fields, I get the value through get('ca_objects.materiaux_tech_c.textfield')
seem to me that there is something with lists here
inside BundlableLabelableBaseModelWithAttributes.php, the treatment is done through $this->_rowAsSearchResult->get($ps_field, $pa_options);
GautierMichelin
@gautiermichelin
May 25 2016 14:01
Am I wrong or is it app/lib/core/SearchResult.php that handles the intelligence here ?
I'm trying to refine where to look at, Stefan, sorry to bother :-(
CollectiveAccess
@collectiveaccess
May 25 2016 14:01
It's all in SearchResult.php
GautierMichelin
@gautiermichelin
May 25 2016 14:01
thanks Seth
CollectiveAccess
@collectiveaccess
May 25 2016 14:01
send me a dump of your database and I'll figure out what the issue is
GautierMichelin
@gautiermichelin
May 25 2016 14:02
I'm on it
GautierMichelin
@gautiermichelin
May 25 2016 17:13
ok, I'm removing all but one object with all the lists, I had to ask the data owner the authorization to send you a dump. Thanks