Commit 481fd88827e29a56a906ad426ce38f363d656c1c
1 parent
24ae4a4e
Altered metdata update function
Showing
1 changed file
with
25 additions
and
7 deletions
webservice/clienttools/services/0.2/kt.php
| ... | ... | @@ -972,19 +972,37 @@ class kt extends client_service { |
| 972 | 972 | // } |
| 973 | 973 | // } |
| 974 | 974 | |
| 975 | + /** | |
| 976 | + | |
| 977 | +Fatal error: Cannot unset string offsets in on line 981 | |
| 978 | + */ | |
| 979 | + | |
| 980 | +// foreach($meta as $item){ | |
| 981 | +// $isSpecial=substr($item['name'],0,2)=='__'; | |
| 982 | +// if($isSpecial){ | |
| 983 | +// $special[$item['name']]=$item['value']; | |
| 984 | +// }else{ | |
| 985 | +// $fieldSet=$item['fieldset']; | |
| 986 | +// unset($item['fieldset']); | |
| 987 | +// $metadata[$fieldSet]['fieldset']=$fieldSet; | |
| 988 | +// $metadata[$fieldSet]['fields'][]=$item; | |
| 989 | +// } | |
| 990 | +// } | |
| 991 | + | |
| 992 | + $metadata=array(); | |
| 993 | + $special=array(); | |
| 994 | + | |
| 975 | 995 | foreach($meta as $item){ |
| 976 | - $isSpecial=substr($item['name'],0,2)=='__'; | |
| 977 | - if($isSpecial){ | |
| 996 | + if(substr($item['name'],0,2)=='__'){ | |
| 978 | 997 | $special[$item['name']]=$item['value']; |
| 979 | 998 | }else{ |
| 980 | - $fieldSet=$item['fieldset']; | |
| 981 | - unset($item['fieldset']); | |
| 982 | - $metadata[$fieldSet]['fieldset']=$fieldSet; | |
| 983 | - $metadata[$fieldSet]['fields'][]=$item; | |
| 984 | - } | |
| 999 | + $metadata[$item['fieldset']]['fieldset']=$item['fieldset']; | |
| 1000 | + $metadata[$item['fieldset']]['fields'][]=array('name'=>$item['name'],'value'=>$item['value']); | |
| 1001 | + } | |
| 985 | 1002 | } |
| 986 | 1003 | |
| 987 | 1004 | |
| 1005 | + | |
| 988 | 1006 | $this->addDebug('after processing',array('metadata'=>$metadata,'special'=>$special)); |
| 989 | 1007 | |
| 990 | 1008 | $document_id=$arr['document_id']; | ... | ... |