Reposition item move after saving

Reposition item move after saving

by Antonio D'Aug -
Number of replies: 1

Hi Mark,
congratulations on the awesome plugin.
I have an element repositioning problem, i use moodle Version 3.10 and adaptable template. When i create a model and i use the reposition item and save all, in the db the background save in the column posy the value -12 and this value is application on all item before it's saved in database.

i have half solved editing file ajax.php

// Loop through the data.
/foreach ($values as $value) {
$element = new stdClass();
$element->id = $value->id;
$element->posx = $value->posx;
$element->posy = $value->posy;
$DB->update_record('customcert_elements', $element);
}
/

// HALF FIX Loop through the data.

foreach ($va
lues as $value) {
if($value->posy == -12){
$element = new stdClass();
$element->id = $value->id;
$element->posx = $value->posx;
$element->posy = $value->posy+12;
}
else {
$element = new stdClass();
$element->id = $value->id;
$element->posx = $value->posx;
$element->posy = $value->posy;

}
$DB->update_record('customcert_elements', $element);

}
but the problem it's not resolve because $value->posy it is not always -12.

do you have any suggestions?

could it be a bug?

tnx


Average of ratings: -
In reply to Antonio D'Aug

Re: Reposition item move after saving

by Mark Nelson -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Sounds like it could be. I saw you created a github issue re: this so will comment there if I find anything.