feat: Resolution of bug Values of some categories are altered to the … #198
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix: Empty integer fields saved as 0 instead of NULL


Problem Description
When creating or editing classifications in ReLiS, empty integer fields (such as "Number of citations") were being saved as 0 in the database instead of NULL. This caused issues when editing classifications - fields that were intentionally left empty would show 0 instead of remaining empty.
Root Cause
The form processing logic in relis_app/models/DBConnection_mdl.php was only checking for empty date fields to send as NULL to stored procedures, but was not handling empty int or number fields properly. Empty integer fields were being sent as empty strings ('') which MariaDB/MySQL stored procedures automatically convert to 0.
Solution
Modified the form processing logic to check for empty integer fields and send them as NULL instead of empty strings.
Files Changed
relis_app/models/DBConnection_mdl.php - Modified form processing logic in save_reference_mdl() function
Testing
✅ Create a new classification with empty "Number of citations" field
✅ Save the classification - field should store NULL in database
✅ Edit the classification - field should remain empty instead of showing 0
✅ Verify that non-empty integer fields still work correctly
✅ Verify that other field types (text, date, etc.) are not affected