Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-32270

Notice: Undefined property: stdClass::$defaulthomepage in /var/www/html/moodle/index.php

XMLWordPrintable

    • MOODLE_22_STABLE
    • MOODLE_21_STABLE, MOODLE_22_STABLE
    • wip-mdl-32270
    • Hide
      1. Login as admin
      2. Enable developer debugging
      3. Remove config "defaulthomepage" from database (using phpmyadmin or any other tool)
      4. click on home page
      5. you should not see any notice, (also keep an eye on error log to make sure no notice/error is generated.)
      Show
      Login as admin Enable developer debugging Remove config "defaulthomepage" from database (using phpmyadmin or any other tool) click on home page you should not see any notice, (also keep an eye on error log to make sure no notice/error is generated.)

      I had upgraded my Moodle site from 1.9 to 2.2.2+.
      After upgrading the site I accessed front page, then I got a notice message "Notice: Undefined property: stdClass::$defaulthomepage in /var/www/html/moodle/index.php" on the top of the front page.
      I didn't use mymoodle on 1.9.

      So, if I change "Debug messages" from NORMAL to NONE, I'll not get the notice message. But now I'm debugging my Moodle2.2.2+ site.

      I modified moodle/index.php as follows for avoiding the notice;

      require_once('config.php');
      require_once($CFG->dirroot .'/course/lib.php');
      require_once($CFG->libdir .'/filelib.php');

      redirect_if_major_upgrade_required();

      $urlparams = array();
      // (Shirai): add from here
      // if (empty($CFG->defaulthomepage)) $CFG->defaulthomepage = NULL;
      // (Shirai): add to here
      if ($CFG->defaulthomepage == HOMEPAGE_MY && optional_param('redirect', 1, PARAM_BOOL) === 0)

      { $urlparams['redirect'] = 0; }

      $PAGE->set_url('/', $urlparams);
      $PAGE->set_course($SITE);

      This modification is not fundamental countermeasure.
      Why $CFG->defaulthomepage does not assigning any value (including NULL)?
      Which process of migrating is assign valid value of $CFG->defaulthomepage?

            rajeshtaneja Rajesh Taneja
            shirai Tatsuya Shirai
            Jason Fowler Jason Fowler
            Sam Hemelryk Sam Hemelryk
            Ankit Agarwal Ankit Agarwal
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.