} } // end of loop for each relation cell } if (isset($_REQUEST['do_transformations']) && $_REQUEST['do_transformations'] == true) { $edited_values = array(); parse_str($_REQUEST['transform_fields_list'], $edited_values); if (!isset($extra_data)) { $extra_data = array(); } $transformation_types = array("input_transformation", "transformation"); foreach ($mime_map as $transformation) { $column_name = $transformation['column_name']; foreach ($transformation_types as $type) { $file = PMA_securePath($transformation[$type]); $extra_data = PMA_transformEditedValues($db, $table, $transformation, $edited_values, $file, $column_name, $extra_data, $type); } } // end of loop for each $mime_map } // Need to check the inline edited value can be truncated by MySQL // without informing while saving $column_name = $_REQUEST['fields_name']['multi_edit'][0][0]; PMA_verifyWhetherValueCanBeTruncatedAndAppendExtraData($db, $table, $column_name, $extra_data); /**Get the total row count of the table*/ $_table = new PMA_Table($_REQUEST['table'], $_REQUEST['db']); $extra_data['row_count'] = $_table->countRecords(); $extra_data['sql_query'] = PMA_Util::getMessage($message, $GLOBALS['display_query']); $response = PMA_Response::getInstance(); $response->isSuccess($message->isSuccess()); $response->addJSON('message', $message);
/** * Test for PMA_transformEditedValues * * @return void */ public function testTransformEditedValues() { $edited_values = array(array('c' => 'cname')); $GLOBALS['cfg']['ServerDefault'] = 1; $_REQUEST['where_clause'] = 1; $transformation = array('transformation_options' => "'','option ,, quoted',abd"); $result = PMA_transformEditedValues('db', 'table', $transformation, $edited_values, 'Text_Plain_Preappend.class.php', 'c', array('a' => 'b')); $this->assertEquals(array('a' => 'b', 'transformations' => array("cnameoption ,, quoted")), $result); }