2 users online. Create an account or sign in to join them.Users
Problems with processRawFieldData()
This is an open discussion with 3 replies, filed under Troubleshooting.
Search
Should the array become? Not sure.
[0] => 'relation_id' => 2003, 'tab' => 'English' [1] => 'relation_id' => NULL, 'tab' => 'Deutsch'
Best place to debug would be in Field::setDataFromPost which is where processRawFieldData is called from. Are there any existing extensions that do the same thing, that you can look through?
The select field does it like this:
public function processRawFieldData($data, &$status, $simulate=false, $entry_id=NULL){
$status = self::__OK__;
if(!is_array($data)) return array('value' => $data, 'handle' => Lang::createHandle($data));
if(empty($data)) return NULL;
$result = array('value' => array(), 'handle' => array());
foreach($data as $value){
$result['value'][] = $value;
$result['handle'][] = Lang::createHandle($value);
}
return $result;
}
Okay, forget about this. There was a typo in displayPublishPanel() which caused a general saving failure. Still it's strange that the error wasn't shown anywhere.
Create an account or sign in to comment.
I'm sure I'm doing something stupidly wrong but I'm not able to store multiple field values in an extension I'm working on.
As far as I know,
processRawFieldData()is taking care of the data processing. The passed data array looks like this:Array ( [relation_id] => Array ( [0] => 2003 [1] => ) [tab] => Array ( [0] => Deutsch [1] => Englisch ) )Which should be stored as two separate entries in a table that looks like this:
This is how my function looks like:
function processRawFieldData($data, &$status, $simulate=false, $entry_id=NULL) { $status = self::__OK__; if(empty($data)) return NULL; return $data; }Nothing gets stored and there are no errors.
What am I doing wrong?