mahara-contributors team mailing list archive
-
mahara-contributors team
-
Mailing list archive
-
Message #59410
[Bug 1890214] A patch has been submitted for review
Patch for "master" branch: https://reviews.mahara.org/11130
--
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1890214
Title:
SE framework editor re-creating DB records when not needed
Status in Mahara:
In Progress
Bug description:
On the SmartEvidence framework editor when new information that is not
saved to the DB is added, the javascript form will not have the DB
record ids for this data.
The framework.json.php file is responsible for saving the framework to the DB. The way the algorithm works, it will check if the data from the js form contains the DB ids (uids in the form).
If there are records on the DB that are not present in the js form data, then these are DB records that need to be removed because they have been deleted in the js form.
If there are fields with no uids, then this is new data that needs to be saved.
So if we are adding new standards or elements and save the form, unless we find a way to add the DB ids of the newly created records to the js form, everytime the form is saved it will delete the records and add new ones with same data.
This stops happening for existing records when we reload the page, but will happen again for new data.
To test this:
- create a new framework with name 'New framework' and save
- go into the DB and run the query to get the id
select id, name from framework where name='New framework'
- on the DB run the query to check the standards and elements
select s.id sid, s.shortname,
e.id eid, e.shortname, e.parent from
framework_standard s left join
framework_standard_element e
on e.standard=s.id
where s.framework=<id from query above> order by eid;
- go to the site and without reloading the page or making any changes, save the form again
- on the DB, run the query to get the standards and elements again
- compare the columns 'sid' and 'eid'
expected result: they should be the same for both results
actual result: the sid column values are different comparing both results, and the same thing happens with the eid column values
To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1890214/+subscriptions
References