Issue Details (XML | Word | Printable)

Key: MDL-14336
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Petr Skoda
Reporter: Robert Allerstorfer
Votes: 0
Watchers: 3
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

mdl_data's defaultsort ID not set properly at importing preset.zip

Created: 14/Apr/08 02:14 AM   Updated: 17/Jun/08 02:37 PM
Return to search
Component/s: Database activity module
Affects Version/s: 1.8.5, 1.9
Fix Version/s: 1.9.1

File Attachments: 1. Text File MDL-14336.patch (0.8 kB)

Image Attachments:

1. Author first name - at the bottom.png
(29 kB)

2. Date entered - on top.png
(28 kB)

Database: MySQL
Participants: Mathieu Petit-Clair, Petr Skoda and Robert Allerstorfer
Security Level: None
QA Assignee: Mathieu Petit-Clair
Resolved date: 21/Apr/08
Affected Branches: MOODLE_18_STABLE, MOODLE_19_STABLE
Fixed Branches: MOODLE_19_STABLE


 Description  « Hide
When a preset.zip is imported, values from its preset.xml's <settings></settings> section will be written into the DB table mdl_data. One of these imported settings is the ID number of the field that should act as default sort key. Let's call this ID "PRESETSORTID". It is specified as
<defaultsort>PRESETSORTID</defaultsort>.

The smallest value of the id field of the appropriate mdl_data_fields SQL table is the ID number of the first field, let's call it FIRSTID. If you create a new database activity using a preset and completely delete that activity and re-create it, FIRSTID changes (increases).

The defaultsort field of the appropriate mdl_data SQL table should be filled with
DEFAULTSORTID = FIRSTID + PRESETSORTID -1, however it just gets filled with
DEFAULTSORTID = PRESETSORTID.

This prevents us setting the default sort field using a preset.zip. This is bad because there is currently no other way than using a preset. We only can set the default sort direction (<defaultsortdir>0=ascending or 1=descending</defaultsortdir>), but the default sort field currently is always the Date entered. This does not make sense in many cases.





 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Petr Skoda committed 1 file to 'Moodle CVS' on branch 'MOODLE_19_STABLE' - 21/Apr/08 03:21 AM
MDL-14336 defaultsort now stored as field name in preset.xml
MODIFY mod/data/lib.php   Rev. 1.137.2.28    (+46 -15 lines)
Petr Skoda committed 1 file to 'Moodle CVS' - 21/Apr/08 03:22 AM
MDL-14336 defaultsort now stored as field name in preset.xml; merged from MOODLE_19_STABLE
MODIFY mod/data/lib.php   Rev. 1.166    (+46 -15 lines)