Can’t filter search result - php

My Elasticsearch query is like that:
array(
'index' => 'myindex',
'type' => 'myindextype',
'from' => 0,
'size' => 500,
'body' => array(
'query' => array(
'filtered' => array(
'filter' => NULL,
'query' => array(
'query_string' => array(
'default_operator' => 'AND',
'query' => 'atm*',
'minimum_should_match' => '80%',
'default_field' => 'index'
)
)
)
)
)
);
Result is like that:
array(
'took' => 6,
'timed_out' => false,
'_shards' => array(
'total' => 5,
'successful' => 5,
'failed' => 0
),
'hits' => array(
'total' => 492,
'max_score' => 1,
'hits' => array(
0 => array(
'_index' => 'myindex',
'_type' => 'myindextype',
'_id' => 'Branch-571',
'_score' => 1,
'_source' => array(
'indexId' => 'Branch-571',
'objId' => '571',
'index' => 'atm Baki CNaxcivanski lisey Baki sheh Zig shossesi Admiral Naximov kuc 1 ',
'type' => 'Branch',
'title' => 'Bakı C.Naxçıvanski lisey'
)
),
.................................................................................................
196 => array(
'_index' => 'myindex',
'_type' => 'myindextype',
'_id' => 'Page-114',
'_score' => 1,
'_source' => array(
'indexId' => 'Page-114',
'objId' => 'Page-114',
'index' => 'atm Baki CNaxcivanski lisey Baki sheh Zig shossesi Admiral Naximov kuc 1 ',
'type' => 'Page',
'title' => 'Kreditlər'
)
)
.................................................................................................
)
)
);
I want to filter result and get results where 'type' => 'Branch' and I change query like that
array(
'index' => 'myindex',
'type' => 'myindextype',
'from' => 0,
'size' => 10,
'body' => array(
'query' => array(
'filtered' => array(
'filter' => array(
'bool' => array(
'must' => array(
'term' => array(
'type' => 'Branch'
)
)
)
),
'query' => array(
'query_string' => array(
'default_operator' => 'AND',
'query' => 'atm*',
'minimum_should_match' => '80%',
'default_field' => 'index'
)
)
)
)
)
);
But this search return nothing.
array(
'took' => 2,
'timed_out' => false,
'_shards' => array(
'total' => 5,
'successful' => 5,
'failed' => 0
),
'hits' => array(
'total' => 0,
'max_score' => NULL,
'hits' => array()
)
);
I think query is right but no idea why it didn't get any result.
Mapping is
array(
'myindex' => array(
'mappings' => array(
'myindextype' => array(
'properties' => array(
'index' => array(
'type' => 'string'
),
'indexId' => array(
'type' => 'string'
),
'objId' => array(
'type' => 'string'
),
'title' => array(
'type' => 'string'
),
'type' => array(
'type' => 'string'
)
)
)
)
)
)

I have find answer myself. The search query must be like that
POST _search
{
"query": {
"bool" : {
"must" : {
"query_string" :{
"query":"atm*",
"default_operator":"AND",
"minimum_should_match":"80%",
"default_field":"index"
}
},
"filter": {
"term": {
"type.keyword": "Branch"
}
}
}
}
}
All is working good now.

Related

Add values from multidimensional array to another array

Hello good morning wherever you are :D, i have a lil problem, i have this code of arrays
$arrayToView is the info of every single user that i want.
$tagsArray are only tags that use every user but i need to merge all the info something like the last array...
$arrayToView = array(
'IVOFACUNDO' = array(
'mails' => 3,
'contacts' => 34,
'blocked' => 23
),
'ESRAYCU' = array(
'mails' => 23,
'contacts' => 124,
'blocked' => 44
)
)
And i have another one like this
$tagsArray= array(
'IVOFACUNDO' = array(
'14' => array(
'id' => 14,
'name' => 'php',
'value' => 1
),
'15' => array(
'id' => 15,
'name' => 'javascript',
'value' => 1
)
),
'ESRAYCU' = array(
'1' => array(
'id' => 1,
'name' => 'python',
'value' => 1
),
'15'=> array(
'id' => 15,
'name' => 'javascript',
'value' => 1
)
)
)
so the question is how i can merge both arrays obviously respectively with the same admin something like this
$arrayToView = array(
'IVOFACUNDO' = array(
'mails' => 3,
'contacts' => 34,
'blocked' => 23,
'tags' => array(
'14' => array(
'id' => 14,
'name' => 'php',
'value' => 1
),
'15' => array(
'id' => 15,
'name' => 'javascript',
'value' => 1
)
)
),
'ESRAYCU' = array(
'mails' => 23,
'contacts' => 124,
'blocked' => 44,
'tags' => array(
'1' => array(
'id' => 1,
'name' => 'python',
'value' => 1
),
'15'=> array(
'id' => 15,
'name' => 'javascript',
'value' => 1
)
)
)
)
The key 'tags' need to be created in the merge of every iteration to add and get one array with all the values, how i can do this?
You can try this snippet.
foreach($arrayToView as $key => $arr){
if(array_key_exists($key, $tagsArray)){
$arrayToView[$key]['tags'] = $tagsArray[$key];
}
}
echo '<pre>';print_r($arrayToView);echo '</pre>';
Use php inbuilt function
$result_Arr = array_merge_recursive($arrayToView,$tagsArray);
<?php
$arrayToView = array(
'IVOFACUNDO' => array(
'mails' => 3,
'contacts' => 34,
'blocked' => 23
),
'ESRAYCU' => array(
'mails' => 23,
'contacts' => 124,
'blocked' => 44
)
);
$tagsArray= array(
'IVOFACUNDO' => array(
'14' => array(
'id' => 14,
'name' => 'php',
'value' => 1
),
'15' => array(
'id' => 15,
'name' => 'javascript',
'value' => 1
)
),
'ESRAYCU' => array(
'1' => array(
'id' => 1,
'name' => 'python',
'value' => 1
),
'15'=> array(
'id' => 15,
'name' => 'javascript',
'value' => 1
)
)
);
foreach($arrayToView as $key => $value){
if(isset($tagsArray[$key])){
$arrayToView[$key]['tags'] = array();
foreach($tagsArray[$key] as $key2 => $value2){
$arrayToView[$key]['tags'][$key2] = $tagsArray[$key][$key2];
}
}
}
echo'<pre>';
print_r($arrayToView);
echo'</pre>';
?>

Typo3 use realurl to mask tx_news_pi1 parameter in URL

I am pretty new to typo3. The Website is all set up now i want to use realurl to make some human readable URLS.
Out of the boy it works pretty well. But not for my news sites.
http://myDomain/news-events/news/Name-of-the-Article/?tx_news_pi1%5Bday%5D=19&tx_news_pi1%5Bmonth%5D=7&tx_news_pi1%5Byear%5D=2017&cHash=6af067caeb037b4de744f6b9e07b73e8
Please help me to get rid of the last Parameters.
to get something like:
http://myDomain/news-events/news/Name-of-the-Article/
Here is my realurl_conf
[ See Update]
Thank you all for your time =)
Update:
So i worked my way through the manual.
I copied from them and inserted my IDs and Stuff
this is my new Configuration [ Deleted the first one ]
<?php
$GLOBALS['TYPO3_CONF_VARS']['FE']['addRootLineFields'] .= ',tx_realurl_pathsegment';
// Adjust to your needs
$domain = 'http://mydomain.de';
$rootPageUid = 1;
#$rssFeedPageType = 9818; // pageType of your RSS feed page
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'][$domain] = array(
'pagePath' => array(
'type' => 'user',
'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
'spaceCharacter' => '-',
'languageGetVar' => 'L',
'expireDays' => '3',
'rootpage_id' => $rootPageUid,
'firstHitPathCache' => 1
),
'init' => array(
'enableCHashCache' => TRUE,
'respectSimulateStaticURLs' => 0,
'appendMissingSlash' => 'ifNotFile,redirect',
'adminJumpToBackend' => TRUE,
'enableUrlDecodeCache' => TRUE,
'enableUrlEncodeCache' => TRUE,
'emptyUrlReturnValue' => '/',
),
'fileName' => array(
'defaultToHTMLsuffixOnPrev' => 0,
'acceptHTMLsuffix' => 1,
'index' => array(
# 'feed.rss' => array(
# 'keyValues' => array(
# 'type' => $rssFeedPageType,
# )
# )
)
),
'preVars' => array(
array(
'GETvar' => 'L',
'valueMap' => array(
# 'en' => '1',
),
'noMatch' => 'bypass',
),
array(
'GETvar' => 'no_cache',
'valueMap' => array(
'nc' => 1,
),
'noMatch' => 'bypass',
),
),
'fixedPostVars' => array(
'newsDetailConfiguration' => array(
array(
'GETvar' => 'tx_news_pi1[action]',
'valueMap' => array(
'detail' => '',
),
'noMatch' => 'bypass'
),
array(
'GETvar' => 'tx_news_pi1[controller]',
'valueMap' => array(
'News' => '',
),
'noMatch' => 'bypass'
),
array(
'GETvar' => 'tx_news_pi1[news]',
'lookUpTable' => array(
'table' => 'tx_news_domain_model_news',
'id_field' => 'uid',
'alias_field' => "CONCAT(uid, '-', IF(path_segment!='',path_segment,title))",
/** OR ***************/
'alias_field' => 'IF(path_segment!="",path_segment,title)',
/** OR ***************/
'alias_field' => "CONCAT(uid, '-', title)",
'addWhereClause' => ' AND NOT deleted',
'useUniqueCache' => 1, # 1?
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-'
),
'languageGetVar' => 'L',
'languageExceptionUids' => '',
'languageField' => 'sys_language_uid',
'transOrigPointerField' => 'l10n_parent',
'expireDays' => 180,
),
#Depends ?
array(
'GETvar' => 'tx_news_pi1[day]',
'noMatch' => 'bypass',
),
array(
'GETvar' => 'tx_news_pi1[month]',
'noMatch' => 'bypass',
),
array(
'GETvar' => 'tx_news_pi1[year]',
'noMatch' => 'bypass',
),
),
'newsCategoryConfiguration' => array(
array(
'GETvar' => 'tx_news_pi1[overwriteDemand][categories]',
'lookUpTable' => array(
'table' => 'sys_category',
'id_field' => 'uid',
'alias_field' => 'title',
'addWhereClause' => ' AND NOT deleted',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-'
)
)
)
),
'newsTagConfiguration' => array(
array(
'GETvar' => 'tx_news_pi1[overwriteDemand][tags]',
'lookUpTable' => array(
'table' => 'tx_news_domain_model_tag',
'id_field' => 'uid',
'alias_field' => 'title',
'addWhereClause' => ' AND NOT deleted',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-'
)
)
)
),
#TODO: ID-News Seite Finden
#'145' => 'newsDetailConfiguration',
#'147' => 'newsDetailConfiguration', // For additional detail pages, add their uid as well
#'134' => 'newsDetailConfiguration', // For additional detail pages, add their uid as well
'148' => 'newsDetailConfiguration', // For additional detail pages, add their uid as well
'149' => 'newsDetailConfiguration', // For additional detail pages, add their uid as well
#'71' => 'newsTagConfiguration',
#'72' => 'newsCategoryConfiguration',
),
'postVarSets' => array(
'_DEFAULT' => array(
'controller' => array(
array(
'GETvar' => 'tx_news_pi1[action]',
'noMatch' => 'bypass'
),
array(
'GETvar' => 'tx_news_pi1[controller]',
'noMatch' => 'bypass'
)
),
'dateFilter' => array(
array(
'GETvar' => 'tx_news_pi1[overwriteDemand][year]',
),
array(
'GETvar' => 'tx_news_pi1[overwriteDemand][month]',
),
),
'page' => array(
array(
'GETvar' => 'tx_news_pi1[#widget_0][currentPage]',
),
),
),
),
)
);
But still there are the
tx_news_pi1[day], tx_news_pi1[month], tx_news_pi1[year] and cHash
Parameters in the URL.
Please Help me to get rid of them.
thats my configuration:
<?php
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']=array (
'_DEFAULT' => array (
'init' => array (
'appendMissingSlash' => 'ifNotFile,redirect',
'emptyUrlReturnValue' => '/',
),
'pagePath' => array (
'rootpage_id' => '2',
),
'fileName' => array (
'defaultToHTMLsuffixOnPrev' => 0,
'acceptHTMLsuffix' => 1,
'index' => array (
'print' => array (
'keyValues' => array (
'type' => 98,
),
),
),
),
'preVars' => array(
array(
'GETvar' => 'L',
'valueMap' => array(
'en' => '1',
),
'noMatch' => 'bypass',
),
array(
'GETvar' => 'no_cache',
'valueMap' => array(
'nc' => 1,
),
'noMatch' => 'bypass',
),
),
'fixedPostVars' => array(
// config for single/detail news:
'newsDetailConfiguration' => array(
array(
'GETvar' => 'tx_news_pi1[action]',
'valueMap' => array(
'detail' => '',
),
'noMatch' => 'bypass'
),
array(
'GETvar' => 'tx_news_pi1[controller]',
'valueMap' => array(
'News' => '',
),
'noMatch' => 'bypass'
),
array(
'GETvar' => 'tx_news_pi1[news]',
'lookUpTable' => array(
'table' => 'tx_news_domain_model_news',
'id_field' => 'uid',
'alias_field' => 'concat(uid,\'_\',title)',
'addWhereClause' => ' AND NOT deleted',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-'
),
'languageGetVar' => 'L',
'languageExceptionUids' => '',
'languageField' => 'sys_language_uid',
'transOrigPointerField' => 'l10n_parent',
'autoUpdate' => 1,
'expireDays' => 180,
)
)
),
// config for category selection:
'newsCategoryConfiguration' => array(
array(
'GETvar' => 'tx_news_pi1[overwriteDemand][categories]',
'lookUpTable' => array(
'table' => 'sys_category',
'id_field' => 'uid',
'alias_field' => 'title',
'addWhereClause' => ' AND NOT deleted',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-'
)
)
)
),
// configuration for tag selection:
'newsTagConfiguration' => array(
array(
'GETvar' => 'tx_news_pi1[overwriteDemand][tags]',
'lookUpTable' => array(
'table' => 'tx_news_domain_model_tag',
'id_field' => 'uid',
'alias_field' => 'title',
'addWhereClause' => ' AND NOT deleted',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-'
)
)
)
),
// add your page uids where you have detail view of news:
'70' => 'newsDetailConfiguration',
//'701' => 'newsDetailConfiguration', // For additional detail pages, add their uid as well
/connect page uid for further views: tag-selection, category-selection"
'71' => 'newsTagConfiguration',
'72' => 'newsCategoryConfiguration',
),
'postVarSets' => array(
'_DEFAULT' => array(
'controller' => array(
array(
'GETvar' => 'tx_news_pi1[action]',
'noMatch' => 'bypass'
),
array(
'GETvar' => 'tx_news_pi1[controller]',
'noMatch' => 'bypass'
)
),
'dateFilter' => array(
array(
'GETvar' => 'tx_news_pi1[overwriteDemand][year]',
),
array(
'GETvar' => 'tx_news_pi1[overwriteDemand][month]',
),
),
'page' => array(
array(
'GETvar' => 'tx_news_pi1[#widget_0][currentPage]',
),
),
),
),
),
);
look for the right insertion in the array. For that have a clean indention!
The already mentioned link is quite useful and contains detailed info:
https://docs.typo3.org/typo3cms/extensions/news/AdministratorManual/BestPractice/Realurl/Index.html
There are 3 ways explained there:
a basic one which still shows action and controller name as an URL path segment
an advanced example (the one Bernd Wilke is using in his sample as well)
a TypoScript solution to avoid controller and action name in URL
Option 2 can only be used if you show your detail news on a dedicated pages (separate page for list and detail view) as you configure a preset for a controller and action name for a special page (uid) - your news detail view.
Option 3 basically does the same as Option 2, but on a TypoScript level and it can be used in a case where list and detail view is on one single page.
Both options can / should be used in combination with the setting skipControllerAndAction = 1.
In case you want to use the basic setup. The postVarSets is on the same level as fixedPortsVars or preVars
Additional hint:
Do you use any other language than DE or EN as your default language? If so your default language has sys language uid of 0 and thus all good.
The default language usually has sys language uid of 0. If you do not need a default language path segment, you leave it out in our real url config thus it gets bypassed.
More info on language setup: https://github.com/dmitryd/typo3-realurl/wiki/Notes-for-Integrators#configuring-languages
RealUrl Doc:
https://github.com/dmitryd/typo3-realurl/wiki

Elasticsearch range filter not working (No filter registered for)

I'm trying ta add a range filter to my search (only articles with workflow status <= 5 should appear) and getting errors
what's wrong with my range?
$searchParams = array(
'index' => $config->search->index,
'type' => 'xxxxxxxxxx',
'size' => 10,
'from' => ($page - 1) * 10,
'body' => array(
'query' => array(
'filtered' => array(
'query' => array(
'multi_match' => array(
'query' => $query,
'fields' => array('title^8', 'caption^5', 'teasertext^4', 'articletext^2') // ^x = Gewichtung des Felds
),
),
'filter' => array(
'bool' => array(
'must' => array(
'term' => array(
'deleted' => 0,
'visible' => 1
),
'range' => array(
'workflow_status' => array('lte' => '5')
)
)
)
)
)
)
),
'sort' => array('_score', '_id:desc')
here my mapping for status:
"workflow_status": {
"type": "integer",
"index": "not_analyzed"
}
What you have is not a valid Query DSL , must should take in an array.
The body should be something on these lines :
body =>
array(
'query' => array(
'filtered' => array(
'query' => array(
'multi_match' => array(
'query' => $query,
'fields' => array('title^8', 'caption^5', 'teasertext^4', 'articletext^2') // ^x = Gewichtung des Felds
),
),
'filter' => array(
'bool' => array(
'must' => array(
array(
'term' => array(
'deleted' => 0
)
),
array('term' => array(
'visible' => 1
)
),
array(
'range' => array(
'workflow_status' => array('lte' => '5')
)
)
)

Aggregations are empty with keyword tokenizer

For an aggregation result i have a field (type_name2) in my mapping with a lowercased filter and a keyword tokenizer. But if I set this filter and tokenizer to the field my bucket is now empty. I have set this token and filter to ignoring spaces in words like: Fun X or Viva X.
Here my mapping (in PHP):
'cars' => array(
'properties' => array(
/**'type_name2' => array(
'type' => 'string',
'fields' => array(
'raw' => array(
'type' => 'string',
'analyzer' => 'keyword'
)
)
),**/
'type_name2' => array(
'type' => 'string',
'analyzer' => 'keyword_lower'
),
'type_kw' => array(
'type' => 'float'
),
'type_hp' => array(
'type' => 'float'
)
)
),
and the custom analyzer:
'analysis' => array(
'analyzer' => array(
'keyword_lower' => array(
'tokenizer' => 'keyword',
'filter' => 'lowercase'
),
'nGram_analyzer' => array(
'type' => 'custom',
'tokenizer' => 'whitespace',
'filter' => array(
'lowercase',
'asciifolding',
'nGram_filter'
)
),
'whitespace_analyzer' => array(
'type' => 'custom',
'tokenizer' => 'whitespace',
'filter' => array(
'lowercase',
'asciifolding'
)
)
),
'filter' => array(
'nGram_filter' => array(
'type' => 'ngram',
'min_gram' => 2,
'max_gram' => 20,
'token_chars' => array(
'letter',
'digit',
'punctation',
'symbol'
)
),
)
)
but the result of type_name2 is empty:
'type_name2' =>
array (size=1)
'buckets' =>
array (size=0)
empty
Any ideas, what is wrong?
Thx and regards
Stefan

PHP recursion not going back to foreach loop

Need some guidance with some PHP recursion, I'm looping through some data comparing it against a Map, and if a form (in the data) has a subform it needs to be added to the DB with the parents forms ID.
All seems to be working except a subform is an array as there can be multiple subforms of the same type.
Heres a brief structure:
Parent[0]
SF_1[0]
_SF_2[0]
_SF_2[1]
_SF_2[n]
SF_1[1]
SF_2[0]
SF_n[0]
So I add the parent in a separate function, then start the subform recursion (this bit works fine):
private function add_form_records($_data, $map)
{
$form = new FormItem();
foreach($map["fields"] as $item) {
$key = $item->field;
if(array_key_exists($key, $_data))
{
$form->column_data->$key = $_data[$key];
}
}
$form->list_name = $map["sp_list"];
$form->form_id = $this->id_count;
$form->__metadata->type = $this->get_list_id($form->list_name);
//Add the form to SP and get the ID back for the subforms
$id = $this->add_record($form);
foreach($map["subforms"] as $key=>$value) {
$this->add_subform_records($_data[$key], $value, $form->form_id);
}
}
Then heres the function that gets called to add the subforms and then call itself it the subform has subforms:
private function add_subform_records($_data, $_map, $_parent_id)
{
for ($i = 0; $i < count($_data); ++$i) {
$form = new FormItem();
foreach($_map["fields"] as $fieldItem)
{
$key = $fieldItem->field;
if(array_key_exists($key, $_data[$i]))
{
$form->column_data->$key = $_data[$i][$key];
}
}
$form->parent_id = $_parent_id;
$form->list_name = $_map["sp_list"];
$form->form_id = $this->id_count;
$form->form_name = $_map["subform_name"];
$form->__metadata->type = $this->get_list_id($form->list_name);
$id = $this->add_record($form);
if(array_key_exists('subforms', $_map))
{
foreach($_map["subforms"] as $key=>$value) {
foreach($_data as $subform)
{
if(array_key_exists($key, $subform))
{
$this->add_subform_records($subform[$key],$value, $form->form_id);
}
}
}
}
}
}
So the problem is it adds the first subform, goes to add its subforms (and does) but doesn't come back to the for ($i = 0; $i < count($_data); ++$i) to add the others.
Thanks!
$_data
array ( '_submit' => 'submit', '_submittedTime' => '1386837565194', '_submittedTimezoneOffset' => '11', 'ReportedBy' => 'test', 'DateAndTime' => '2013-12-12 19:38', 'Location' => 'hello', 'ClientName' => 'my', 'DiscussionType' => 'Meeting', 'SF_Attendees' => array ( 0 => array ( 'AttendeeName' => 'name', 'Company' => 'is', 'SF_Trip' => array ( 0 => array ( 'test1' => '/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgICAgMCAgIDAwMDBAYEBAQEBAgGBgUGCQgKCgkICQkKDA8MCgsOCwkJDRENDg8QEBEQCgwSExIQEw8QEBD/2wBDAQMDAwQDBAgEBAgQCwkLEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBD/wAARCABgAIADASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ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cnirwxDqwtPD+hyW32hkhlnnuN8suBjJAAQZOTjBxnGe5oaxG9u5vrRnDBmRstkEg9s/55rswdlRUV0MqsffuyxpX9maZGz3CAGBQABgZz6msLVli1eyTWreUusd3coVHSMAxgDPfJPHsPatKyutC1K5E2q2srxRqrMisBntjJwDg9c9ufTPI6/rSWckujWN0JI0ufMcg52qenBx3k/MCuiU3KNjPkszbtgDGDipwiHgiqmnTrLCrDBBFaCKD24qE7ozcbaDBHCexpQkQYLk5PNTBR1GRUbo2/AAxTJsReWpkxnipDAoUsHBpyw85IWnlQiFz2HrQxpHL+J4hJouppjP8Aok5H1EbYr55h8L2Hj74y6R4a8QeOrPwjpmtC1jk1i9Gbe0BgUBpOQANy4ySAM5JA5r0f45fE+48DwW+naPBBdX17FPLNDJkjyApXsQQSTwf9g18n+JfiBeeILqCa90/7G0cCQL5bMAVUnBIPfkivKrJyqPsdHOoRS6nofiBdQ8H65rem6F4pa/i06/ms49TsZGSO6tzuiZ1I52SKendWx3rWMYu/DMYxnapT8iV/pXD6LHbXWnTodbtpGOM5EmcDnnK13OjzW76NJbi6RwrE5Cnv83ce9dmEXK7MxnLm1P/Z', '_action' => 'add', 'test1_mimetype' => 'image/jpeg', 'test2' => '', 'test3' => '', ), ), '_action' => 'add', ), 1 => array ( 'AttendeeName' => 'S', 'Company' => 'T', '_action' => 'add', ), ), 'ReasonforMeeting' => 'test', 'FollowUp' => '2013-12-19 19:38', 'UserEmail' => 'dev#dev.com', 'EmailCopyTo' => 's#s.com', 'SF_Attend' => array ( 0 => array ( 'AttendeeName' => 'test', 'Company' => 'test', '_action' => 'add', ), ), '_action' => 'add', '_uuid' => '63FD4677-C72A-4F1A-B711-963849B6840B', '_DateAndTime_time_offset' => '+11:00', '_FollowUp_time_offset' => '+11:00', )
$map
array ( 'sp_list' => 'ClientMeetingNote', 'fields' => array ( 0 => SchemaItem::__set_state(array( 'field' => 'ReportedBy', 'type' => 'textbox', )), 1 => SchemaItem::__set_state(array( 'field' => 'DateAndTime', 'type' => 'timestamp', )), 2 => SchemaItem::__set_state(array( 'field' => 'Location', 'type' => 'textbox', )), 3 => SchemaItem::__set_state(array( 'field' => 'ClientName', 'type' => 'textbox', )), 4 => SchemaItem::__set_state(array( 'field' => 'DiscussionType', 'type' => 'radio', )), 5 => SchemaItem::__set_state(array( 'field' => 'ReasonforMeeting', 'type' => 'text_area', )), 6 => SchemaItem::__set_state(array( 'field' => 'FollowUp', 'type' => 'timestamp', )), 7 => SchemaItem::__set_state(array( 'field' => 'Signature', 'type' => 'sketch_signature', )), 8 => SchemaItem::__set_state(array( 'field' => 'UserEmail', 'type' => 'email', )), 9 => SchemaItem::__set_state(array( 'field' => 'EmailCopyTo', 'type' => 'email', )), ), 'subforms' => array ( 'SF_Attendees' => array ( 'subform_name' => 'SF_Attendees', 'subform_data_name' => 'SF_Attendees', 'sp_list' => 'Attendees', 'fields' => array ( 0 => SchemaItem::__set_state(array( 'field' => 'AttendeeName', 'type' => 'textbox', )), 1 => SchemaItem::__set_state(array( 'field' => 'Company', 'type' => 'textbox', )), ), 'subforms' => array ( 'SF_Trip' => array ( 'subform_name' => 'SF_Trip', 'subform_data_name' => 'SF_Trip', 'sp_list' => 'Trip', 'fields' => array ( 0 => SchemaItem::__set_state(array( 'field' => 'test1', 'type' => 'camera', )), 1 => SchemaItem::__set_state(array( 'field' => 'test2', 'type' => 'image_library', )), 2 => SchemaItem::__set_state(array( 'field' => 'test3', 'type' => 'file_upload', )), ), ), ), ), 'SF_Attend' => array ( 'subform_name' => 'SF_Attend', 'subform_data_name' => 'SF_Attendees', 'sp_list' => 'Attendees', 'fields' => array ( 0 => SchemaItem::__set_state(array( 'field' => 'AttendeeName', 'type' => 'textbox', )), 1 => SchemaItem::__set_state(array( 'field' => 'Company', 'type' => 'textbox', )), ), 'subforms' => array ( 'SF_Trip' => array ( 'subform_name' => 'SF_Trip', 'subform_data_name' => 'SF_Trip', 'sp_list' => 'Trip', 'fields' => array ( 0 => SchemaItem::__set_state(array( 'field' => 'test1', 'type' => 'camera', )), 1 => SchemaItem::__set_state(array( 'field' => 'test2', 'type' => 'image_library', )), 2 => SchemaItem::__set_state(array( 'field' => 'test3', 'type' => 'file_upload', )), ), ), ), ), ), )
Figured it out!! Had to restructure code as it was looping through the data twice, recursion was working fine I was sending it the wrong data.

Categories