Permalink
Browse files

MDL-27781 remove Undefined property: stdClass:: during installation w…

…ith cli script
  • Loading branch information...
mouneyrac committed Jun 9, 2011
1 parent 6911fa1 commit 565e477184ec32f545646a60c9760598d25ccf65
Showing with 12 additions and 0 deletions.
  1. +12 −0 lib/adminlib.php
View
@@ -6569,6 +6569,12 @@ public function output_html($data, $query='') {
*/
public function get_setting() {
global $CFG;
+
+ //for install cli script, $CFG->defaultuserroleid is not set so return 0
+ if (empty($CFG->defaultuserroleid)) {
+ return 0;
+ }
+
$webservicesystem = $CFG->enablewebservices;
require_once($CFG->dirroot . '/webservice/lib.php');
$webservicemanager = new webservice();
@@ -6588,6 +6594,12 @@ public function get_setting() {
*/
public function write_setting($data) {
global $DB, $CFG;
+
+ //for install cli script, $CFG->defaultuserroleid is not set so do nothing
+ if (empty($CFG->defaultuserroleid)) {
+ return '';
+ }
+
$servicename = MOODLE_OFFICIAL_MOBILE_SERVICE;
require_once($CFG->dirroot . '/webservice/lib.php');

0 comments on commit 565e477

Please sign in to comment.