Commit 85e2c0ce authored by Chivy Lim's avatar Chivy Lim

Merge branch 'KIME-4583' into 'master'

[IMP] Static argument parameter instead of default

Don't support default value but use it as static value. It's dangerous
if it can be overwritten by parameter. Additionally, it might have
problem with type casting.

refs KIME-4583

See merge request !8
parents ec1eae53 e3afd64a
......@@ -46,8 +46,11 @@ class FrontendMappingService {
if (is_array($contextArguments)) {
foreach ($contextArguments as $contextArgument) {
$name = $contextArgument['name'];
$default = isset($contextArgument['default']) ? $contextArgument['default'] : NULL;
$arguments[$name] = $request->hasArgument($name) ? $request->getArgument($name) : $default;
if (isset($contextArgument['static'])) {
$arguments[$name] = $contextArgument['static'];
} else {
$arguments[$name] = $request->hasArgument($name) ? $request->getArgument($name) : NULL;
}
}
}
return $arguments;
......
......@@ -355,12 +355,10 @@ class SpreadsheetImportService {
} else {
$value = $arguments[$name];
}
} else {
$value = array_key_exists('default', $contextArgument) ? $contextArgument['default'] : NULL;
}
$setter = 'set' . ucfirst($name);
$object->$setter($value);
}
}
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment