Moodle

Database connection failed messate in lib/setup.php in other lands via config.php variable

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.5, 1.5.1, 1.5.2, 1.5.3, 1.5.4, 1.6, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.6.5, 1.6.6, 1.7, 1.7.1, 1.7.2, 1.7.3, 1.7.4, 1.8, 1.8.1, 1.8.2, 1.8.3, 1.8.4
  • Fix Version/s: 2.0
  • Component/s: Administration, Language
  • Labels:
    None
  • Environment:
    1.6.4
  • Database:
    Any
  • Affected Branches:
    MOODLE_15_STABLE, MOODLE_16_STABLE, MOODLE_17_STABLE, MOODLE_18_STABLE
  • Fixed Branches:
    MOODLE_20_STABLE

Description

The moodle equivalent of the blue screen of death is the "for human consumption" lines from 132 in lib/setup.php

As moodle gets more content, more users the more students are seeing this page. Alas the page is displayed only in English.It would be nice to be able to display this most important of pages in other languages, perhaps all the site languages somehow. I am hacking my setup.php.

Activity

Hide
Martin Dougiamas added a comment -

Really you need to fix the actual problem, which is that the database is down (not Moodle).

However, using the language packs for this message is still a good idea. I guess we could have an optional hardcoded setting in config.php to determine the language to use.

Show
Martin Dougiamas added a comment - Really you need to fix the actual problem, which is that the database is down (not Moodle). However, using the language packs for this message is still a good idea. I guess we could have an optional hardcoded setting in config.php to determine the language to use.
Hide
Timothy Takemoto added a comment -

>Really you need to fix the actual problem, which is that the database is down (not Moodle).
Sorry, yes. The parallel with the blue screen of death is tenuous to say the least. The problem is all mine.
> optional hardcoded setting in config.php
I think that would be nice, because even though it is our own fault, it is still quite an upsetting screen made all the more stressful due to the lack of localisation, my students tell me. I have also put the administrators email address in the message.

Show
Timothy Takemoto added a comment - >Really you need to fix the actual problem, which is that the database is down (not Moodle). Sorry, yes. The parallel with the blue screen of death is tenuous to say the least. The problem is all mine. > optional hardcoded setting in config.php I think that would be nice, because even though it is our own fault, it is still quite an upsetting screen made all the more stressful due to the lack of localisation, my students tell me. I have also put the administrators email address in the message.
Hide
Petr Škoda (skodak) added a comment -

Another solution could be to directly customize the message in config.php:

$CFG->nodbconnectionmsg = 'Database not available, get admin to fix it / ?ekn?te adminovi, a? to laskav? spraví.';

and some isset($CFG->nodbconnectionmsg) in setup.php

Show
Petr Škoda (skodak) added a comment - Another solution could be to directly customize the message in config.php: $CFG->nodbconnectionmsg = 'Database not available, get admin to fix it / ?ekn?te adminovi, a? to laskav? spraví.'; and some isset($CFG->nodbconnectionmsg) in setup.php
Hide
Ian Robotham added a comment -

We have a requirement for this functionality and have implemented it on our systems. Attached is a small patch to implement the functionality - hope this helps somebody else.

Show
Ian Robotham added a comment - We have a requirement for this functionality and have implemented it on our systems. Attached is a small patch to implement the functionality - hope this helps somebody else.
Hide
Petr Škoda (skodak) added a comment -

The db connection error and other early errors are now in lang pack, it means you can:

  • make a local en_utlf8 modification
  • or set $CFG->lang="cs_utf8" (use your preferred lang there) in config PHP

Thanks for the report

Show
Petr Škoda (skodak) added a comment - The db connection error and other early errors are now in lang pack, it means you can:
  • make a local en_utlf8 modification
  • or set $CFG->lang="cs_utf8" (use your preferred lang there) in config PHP
Thanks for the report

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: