Moodle

xml import getpath() doesn't handle 0 values correctly

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.9
  • Fix Version/s: 1.8.3, 1.9
  • Component/s: Questions
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_18_STABLE, MOODLE_19_STABLE

Description

If the value is 0, getpath() in question/format/xml/format.php returns the default value instead of 0 because the empty() check counts 0 as empty.

To replicate, import a matching question with shuffleanswers set to 0. It will be imported with shuffleanswers set to the default value 1.

Activity

Hide
Howard Miller added a comment -

empty() changed to !isset().

Hopefully that should be all it is!

Show
Howard Miller added a comment - empty() changed to !isset(). Hopefully that should be all it is!

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: