mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-9380 Adding a Resource of Type directory leads to SQL errors, patch by Andrew Schmadeke; merged from MOODLE_18_STABLE
This commit is contained in:
parent
e38bbf52c4
commit
a7156b5d7f
1 changed files with 17 additions and 0 deletions
|
@ -6,6 +6,23 @@ function resource_directory($cmid=0) {
|
||||||
parent::resource_base($cmid);
|
parent::resource_base($cmid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function add_instance($resource) {
|
||||||
|
$this->_postprocess($resource);
|
||||||
|
return parent::add_instance($resource);
|
||||||
|
}
|
||||||
|
|
||||||
|
function update_instance($resource) {
|
||||||
|
$this->_postprocess($resource);
|
||||||
|
return parent::update_instance($resource);
|
||||||
|
}
|
||||||
|
|
||||||
|
function _postprocess(&$resource) {
|
||||||
|
if($resource->reference=='0')
|
||||||
|
$resource->reference = '';
|
||||||
|
|
||||||
|
$resource->popup = '';
|
||||||
|
$resource->alltext = '';
|
||||||
|
}
|
||||||
|
|
||||||
function display() {
|
function display() {
|
||||||
global $CFG;
|
global $CFG;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue