Non-core contributed modules

Global constants not working in 2.0

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 2.0
  • Fix Version/s: 2.0
  • Component/s: Module: Questionnaire
  • Labels:
    None
  • Affected Branches:
    MOODLE_20_STABLE
  • Fixed Branches:
    MOODLE_20_STABLE

Description

For some reason, many of the global constants are not working in 2.0. For example, adding a questionnaire gives:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND (realm = 'template' OR owner = '2') ORDER BY realm,name' at line 1

SELECT id,name,owner,realm,status,title FROM mdl_questionnaire_survey WHERE status != AND (realm = 'template' OR owner = '2') ORDER BY realm,name
[array ( )]
line 305 of lib\dml\moodle_database.php: dml_read_exception thrown

  • line 558 of lib\dml\mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 913 of lib\dml\moodle_database.php: call to mysqli_native_moodle_database->get_records_sql()
  • line 606 of mod\questionnaire\lib.php: call to moodle_database->get_records_select()
  • line 625 of mod\questionnaire\lib.php: call to questionnaire_get_survey_list()
  • line 88 of mod\questionnaire\mod_form.php: call to questionnaire_get_survey_select()
  • line 152 of lib\formslib.php: call to mod_questionnaire_mod_form->definition()
  • line 60 of course\moodleform_mod.php: call to moodleform->moodleform()
  • line 215 of course\modedit.php: call to moodleform_mod->moodleform_mod()

These seem to work if they are changed to 'define' constants, which they should be anyway.

Activity

Hide
Mike Churchward added a comment -

Changed may globals to defined constants, and assured proper global use by adding "global" statement where they are defined as well. Removed all uses of old $ESPCONFIG variable.

Show
Mike Churchward added a comment - Changed may globals to defined constants, and assured proper global use by adding "global" statement where they are defined as well. Removed all uses of old $ESPCONFIG variable.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: