-
Improvement
-
Resolution: Won't Do
-
Minor
-
None
-
2.6
Developers can not set a setType() for additional parameters, see in backup/util/ui/base_moodleform.class.php:
function definition() {
|
$ui = $this->uistage->get_ui();
|
$mform = $this->_form;
|
$mform->setDisableShortforms();
|
$stage = $mform->addElement('hidden', 'stage', $this->uistage->get_stage());
|
$mform->setType('stage', PARAM_INT);
|
$stage = $mform->addElement('hidden', $ui->get_name(), $ui->get_uniqueid());
|
$mform->setType($ui->get_name(), PARAM_ALPHANUM);
|
$params = $this->uistage->get_params();
|
if (is_array($params) && count($params) > 0) {
|
foreach ($params as $name=>$value) {
|
// TODO: Horrible hack, but current backup ui structure does not allow
|
// to make this easy (only changing params to objects that would be
|
// possible. MDL-38735.
|
$intparams = array(
|
'contextid', 'importid', 'target');
|
$stage = $mform->addElement('hidden', $name, $value);
|
if (in_array($name, $intparams)) {
|
$mform->setType($name, PARAM_INT);
|
} else {
|
// Adding setType() to avoid missing setType() warnings.
|
// MDL-39126: support $mform->setType() for additional backup parameters.
|
$mform->setType($name, PARAM_RAW);
|
}
|
}
|
}
|
}
|
The way we call backup_ui (from course publish feature):
$backup = new backup_ui($bc,
|
array('id' => $id, 'hubcourseid' => $hubcourseid, 'huburl' => $huburl, 'hubname' => $hubname));
|
The "issue" is that we should have a way to indicate what these parameter type are.
- has been marked as being related by
-
MDL-38888 Publish forms display setType warning
-
- Closed
-