portfolio api MDL-14591 fixing small bugs and removing debugging
This commit is contained in:
@@ -84,7 +84,7 @@ abstract class portfolio_caller_base {
|
||||
foreach ($expected as $key => $required) {
|
||||
if (!array_key_exists($key, $callbackargs)) {
|
||||
if ($required) {
|
||||
$a = (object)array('key' => $key, 'class' => get_class($this));
|
||||
$a = (object)array('arg' => $key, 'class' => get_class($this));
|
||||
throw new portfolio_caller_exception('missingcallbackarg', 'portfolio', null, $a);
|
||||
}
|
||||
continue;
|
||||
|
||||
@@ -639,7 +639,7 @@ class portfolio_exporter {
|
||||
} else {
|
||||
if (!$r = $DB->get_record('portfolio_tempdata', array('id' => $this->id))) {
|
||||
if (!$this->deleted) {
|
||||
debugging("tried to save current object, but failed - see MDL-20872");
|
||||
//debugging("tried to save current object, but failed - see MDL-20872");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -136,13 +136,13 @@ class portfolio_add_button {
|
||||
|
||||
$file = substr($backtrace[0]['file'], strlen($CFG->dirroot));
|
||||
} else if (!is_readable($CFG->dirroot . $file)) {
|
||||
throw new portfolio_button_exception('nocallbackfile', 'portfolio', $file);
|
||||
throw new portfolio_button_exception('nocallbackfile', 'portfolio', '', $file);
|
||||
}
|
||||
$this->callbackfile = $file;
|
||||
require_once($CFG->libdir . '/portfolio/caller.php'); // require the base class first
|
||||
require_once($CFG->dirroot . $file);
|
||||
if (!class_exists($class)) {
|
||||
throw new portfolio_button_exception('nocallbackclass', 'portfolio', $class);
|
||||
throw new portfolio_button_exception('nocallbackclass', 'portfolio', '', $class);
|
||||
}
|
||||
|
||||
// this will throw exceptions
|
||||
|
||||
Reference in New Issue
Block a user