-
Bug
-
Resolution: Fixed
-
Minor
-
4.1, 4.2
-
MOODLE_401_STABLE, MOODLE_402_STABLE
-
MOODLE_401_STABLE
-
MDL-77042-401 -
Hi,
If you introduce a 0 on a number field on a database, it is saved but it is not shown afterwards.
- When I edit the entry I see the 0 so I assume it is correctly saved.
- When I see the entry I don't see the 0. I checked the page source and used the inspect and it is not there.
In case it is useful
- If the number is different from 0
<div class="col-4 col-lg-3 font-weight-bold">Number</div>
<div class="col-8 col-lg-9 ml-n3">2</div>
- If the number is 0
<div class="col-4 col-lg-3 font-weight-bold">Number</div>
<div class="col-8 col-lg-9 ml-n3"></div>
To reproduce it
- Add a database on a >=4.1 Moodle site 1
- Add a number field (only this is necessary fill free to add more fields and/or make them required fields)
- Add a template
- Add entry with any user, type a number different from 0 and save it
- Check that you can see the entry and that the browser shows the number correctly
- Add entry with any user, type a 0 and save it
- Check that you can see the entry but that the 0 is not shown
1 I found it on a Moodle 4.2dev (Build: 20230120) and I cannot reproduce on a Moodle 4.0.5 (Build: 20221114) (MoodleCloud). So I am assuming this is related to changes on database on 4.1. I could be wrong and be a more recent change and only affects 4.2 versions
What I expected?
The browser to show the 0
Thanks for your time!
Isabel
- Discovered while testing
-
MOBILE-4234 Database: number fields don't consider 0 as a value
-
- Closed
-
- is a regression caused by
-
MDL-75149 Create a new preview page for Database activity Presets
-
- Closed
-