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

Number custom field is displayed as "0" when it is not set

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 4.5
    • 4.5
    • Course
    • MOODLE_405_STABLE
    • MOODLE_405_STABLE
    • Hide
      1. Create a new course custom field of type 'Number' and call it "Price"
      2. Set "Display as zero" to "Free"
      3. For one course set the value of this field to 0
      4. For another course do not set the value
      5. For the third course set it to 10 (or any other positive number)
      6. Open http://yoursite/course/ page and make sure that the first course is displaeyd as "Free", the second does not have the price field at all and the third one displays "10"
      Show
      Create a new course custom field of type 'Number' and call it "Price" Set "Display as zero" to "Free" For one course set the value of this field to 0 For another course do not set the value For the third course set it to 10 (or any other positive number) Open http://yoursite/course/ page and make sure that the first course is displaeyd as "Free", the second does not have the price field at all and the third one displays "10"

      There are a couple of things I noticed when updating my moodle lms instance today

      • Where I had a number custom field that was not set it displays as "0" . This could be a problem with the fields such as price, if the price is set as "0" they should be displayed as "Free", if the price is not set, the field should not be displayed at all.
      • I got a PHP warning about passing null as the third argument of str_replace
      • Value such as 0.000001 (which can be a glitch in how db stores floats) is displayed as "0.00", it should not be displayed at all (when the "Display as zero" set to "" and the "Decimal places" is set to "2")

            marina Marina Glancy
            marina Marina Glancy
            Paul Holden Paul Holden
            Jun Pataleta Jun Pataleta
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 39 minutes
                2h 39m

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