Non-core contributed modules

GBPV2 "Events" not included in backups

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Blocker Blocker
  • Resolution: Fixed
  • Affects Version/s: 1.7, 1.7.1, 1.7.2, 1.8, 1.8.1, 1.8.2
  • Fix Version/s: 1.8.6
  • Component/s: Patch: Gradebook Plus
  • Labels:
    None
  • Environment:
    PHP 5 MYSQL Apache 2 Ubuntu 7.04
  • Database:
    MySQL
  • Affected Branches:
    MOODLE_17_STABLE, MOODLE_18_STABLE
  • Fixed Branches:
    MOODLE_18_STABLE

Description

The gradebook items added through GBPV2 are not included in the automated or manual backups of Moodle. This is fairly major since backups of a course are missing a major portion of the gradebook if GBPV2 is being utilized. At first glance it appears to be related to the fact that the events are not added like other items. This item it not added to the modules table which is used to parse through the course and backup items.

If GBPV2 were modified to act like a full module (with an ID in the table as well) then the backup and restore would probably work as well. I would like to suggest that GBPV2 become part of the 1.84 core code as well. Thanks, Brian

Activity

Hide
Wen Hao Chuang added a comment -

Anthony did you get a chance to verify this issue does exist with the most recent version of GBPv2? If you need some help to verify this please let me know, thanks!

Show
Wen Hao Chuang added a comment - Anthony did you get a chance to verify this issue does exist with the most recent version of GBPv2? If you need some help to verify this please let me know, thanks!
Hide
Anthony Borrow added a comment -

Unfortunately I have not had a chance to confirm or test this. Let me think through the implications of making GBPv2 part of 1.8 Moodle core. The biggest obstacle would be getting the upgrade to work smoothly from the GBPv2 graded events to 1.9 grade items. It may not be possible/practical as I remember there were some things that were a little strange in the mapping. Peace - Anthony

Show
Anthony Borrow added a comment - Unfortunately I have not had a chance to confirm or test this. Let me think through the implications of making GBPv2 part of 1.8 Moodle core. The biggest obstacle would be getting the upgrade to work smoothly from the GBPv2 graded events to 1.9 grade items. It may not be possible/practical as I remember there were some things that were a little strange in the mapping. Peace - Anthony
Hide
Anthony Borrow added a comment -

Brian - I've begun looking into this. It should not be overly difficult; however, it may be a little time consuming. Currently, I've looked at what modifications need to be made to the /backup/backuplib.php. The first has to do with checking for modid=0 (i.e. gradebook event). I'm not so much concerned about backing up the data but what will be involved in getting it to actually restore. In any case, we have begun to make progress. Peace - Anthony

Show
Anthony Borrow added a comment - Brian - I've begun looking into this. It should not be overly difficult; however, it may be a little time consuming. Currently, I've looked at what modifications need to be made to the /backup/backuplib.php. The first has to do with checking for modid=0 (i.e. gradebook event). I'm not so much concerned about backing up the data but what will be involved in getting it to actually restore. In any case, we have begun to make progress. Peace - Anthony
Hide
Anthony Borrow added a comment -

Here is the first part of a possible patch - one step at a time. Peace - Anthony

Show
Anthony Borrow added a comment - Here is the first part of a possible patch - one step at a time. Peace - Anthony
Hide
Anthony Borrow added a comment -

I've raised the priority of this as I would like it to be the number one priority for GBPv2. Any help with creating the needed patches would be very much appreciated. Then we can move on to CONTRIB-204. Peace - Anthony

Show
Anthony Borrow added a comment - I've raised the priority of this as I would like it to be the number one priority for GBPv2. Any help with creating the needed patches would be very much appreciated. Then we can move on to CONTRIB-204. Peace - Anthony
Hide
Brian Pool added a comment -

I will try and look at it as well when I have time. I do still think the best answer is to make GBPV2 a regular module with a real entry in the modules table. If it is then it whould backup and restore with all the modules as a regular item. There are several places in the code that are "hard coded" for these events that would need to be changed, but I think it is do-able.

Brian

Show
Brian Pool added a comment - I will try and look at it as well when I have time. I do still think the best answer is to make GBPV2 a regular module with a real entry in the modules table. If it is then it whould backup and restore with all the modules as a regular item. There are several places in the code that are "hard coded" for these events that would need to be changed, but I think it is do-able. Brian
Hide
Anthony Borrow added a comment -

Brian - I am not opposed to making GBPv2 a module. I was trying to keep the number of changes to a minimum but there are some definite advantages and I can see where it would be a real time saver. So as you begin to play with possible patches feel free to explore making it a module and helping us to avoid the hard coding. Of course that would mean going back and cleaning up some of the other places where we already assumed that it was just a special case scenario. Peace - Anthony

Show
Anthony Borrow added a comment - Brian - I am not opposed to making GBPv2 a module. I was trying to keep the number of changes to a minimum but there are some definite advantages and I can see where it would be a real time saver. So as you begin to play with possible patches feel free to explore making it a module and helping us to avoid the hard coding. Of course that would mean going back and cleaning up some of the other places where we already assumed that it was just a special case scenario. Peace - Anthony
Hide
Wen Hao Chuang added a comment -

verified this and this problem does still exist in the most recent GBPv2... (same with the stock gradebook in 1.8.x+?)

Show
Wen Hao Chuang added a comment - verified this and this problem does still exist in the most recent GBPv2... (same with the stock gradebook in 1.8.x+?)
Hide
Anthony Borrow added a comment -

To show my line of thought, I am attaching the patch for the backup end of the solution. Note well, the data is backed up but not restored (that's the next step I'll be working on). As I got into the code, I felt that it was best to treat the grade events not as a module but rather as the custom patch that they are. Let me know if you have any comments. Peace - Anthony

Show
Anthony Borrow added a comment - To show my line of thought, I am attaching the patch for the backup end of the solution. Note well, the data is backed up but not restored (that's the next step I'll be working on). As I got into the code, I felt that it was best to treat the grade events not as a module but rather as the custom patch that they are. Let me know if you have any comments. Peace - Anthony
Hide
Anthony Borrow added a comment -

I'm a bit stuck with trying to figure out how to handle the restore from the moodle.xml file. I'm puzzled by the behavior I'm seeing with the $xml_data variable and was hoping someone might be able to shed some light on it or point me in a helpful direction. I am trying to follow the logic used in the /backup/restorelib.php. I created a function called endElementGradeEvents (and also the corresponding startElementGradeEvents) modeled off of the others with the line:

$xml_data = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n".$this->temp;

When I do a var_dump of $xml_data after the above prepend of the xml tag to the $this->temp variable, I see nothing of the prepended text and only get back: string(147) " 13Graded Event #1GE1100.001198891941" (the value of $this->temp). The string length is 147, so where is the rest of the data?

Thanks for any insights you might have to help me move forward. Peace - Anthony

Show
Anthony Borrow added a comment - I'm a bit stuck with trying to figure out how to handle the restore from the moodle.xml file. I'm puzzled by the behavior I'm seeing with the $xml_data variable and was hoping someone might be able to shed some light on it or point me in a helpful direction. I am trying to follow the logic used in the /backup/restorelib.php. I created a function called endElementGradeEvents (and also the corresponding startElementGradeEvents) modeled off of the others with the line: $xml_data = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n".$this->temp; When I do a var_dump of $xml_data after the above prepend of the xml tag to the $this->temp variable, I see nothing of the prepended text and only get back: string(147) " 13Graded Event #1GE1100.001198891941" (the value of $this->temp). The string length is 147, so where is the rest of the data? Thanks for any insights you might have to help me move forward. Peace - Anthony
Hide
Anthony Borrow added a comment -

OK - if you want to see the actual value of a string - don't expect your browser to show it (duh). I think I had too much eggnog over the holidays In any case, once I saw the data using view source I could troubleshoot that I was missing a starting tag. So we are back to making progress. Peace - Anthony

Show
Anthony Borrow added a comment - OK - if you want to see the actual value of a string - don't expect your browser to show it (duh). I think I had too much eggnog over the holidays In any case, once I saw the data using view source I could troubleshoot that I was missing a starting tag. So we are back to making progress. Peace - Anthony
Hide
Anthony Borrow added a comment -

Just thought I would provide a status update. I am getting closer to having a working patch available. Currently, the patch I am working on will backup the grade events and the associated student grades. Having a good backup is one thing but actually getting it restored is another. I can now restore the grade event. Now I am going to work on getting the grade event grades restored. I hope to have this available by the end of the day and then look forward to testing and tweaking. Peace - Anthony

Show
Anthony Borrow added a comment - Just thought I would provide a status update. I am getting closer to having a working patch available. Currently, the patch I am working on will backup the grade events and the associated student grades. Having a good backup is one thing but actually getting it restored is another. I can now restore the grade event. Now I am going to work on getting the grade event grades restored. I hope to have this available by the end of the day and then look forward to testing and tweaking. Peace - Anthony
Hide
Anthony Borrow added a comment - - edited

I have committed three files in folder called /backup which would replace the corresponding files in the Moodle backup folder. For now, I'm posting these backup related files only in HEAD as we are working on resolving this. Once I feel that there has been ample testing and that the code works well, then I will add them to the 18STABLE branch of the GBPv2 patch.

I am aware that the restorelib.php file is already out of sync with the code in 18STABLE and we will need to merge in and keep the files updated. I would like to make some improvements but thought that it might be good to put this initial stab at the code out there for evaluation and commenting. I hope to be able to come back and improve some of the efficiency as noted by CONTRIB-241. Please report back here any problems or comments you might have and thanks for your patience. Peace - Anthony

Show
Anthony Borrow added a comment - - edited I have committed three files in folder called /backup which would replace the corresponding files in the Moodle backup folder. For now, I'm posting these backup related files only in HEAD as we are working on resolving this. Once I feel that there has been ample testing and that the code works well, then I will add them to the 18STABLE branch of the GBPv2 patch. I am aware that the restorelib.php file is already out of sync with the code in 18STABLE and we will need to merge in and keep the files updated. I would like to make some improvements but thought that it might be good to put this initial stab at the code out there for evaluation and commenting. I hope to be able to come back and improve some of the efficiency as noted by CONTRIB-241. Please report back here any problems or comments you might have and thanks for your patience. Peace - Anthony
Hide
Wen Hao Chuang added a comment -

Anthony just want to let you know that I'm looking at these patches now... stay tuned.

Show
Wen Hao Chuang added a comment - Anthony just want to let you know that I'm looking at these patches now... stay tuned.
Hide
Anthony Borrow added a comment -

Wen - Thanks for taking a look at the patches. I will be in Mexico (I leave on the 17th) and will not be back in California until Feb. 4th and then I'll be jumping into a new semester. So feel free to take your time looking over the patches. Peace - Anthony

Show
Anthony Borrow added a comment - Wen - Thanks for taking a look at the patches. I will be in Mexico (I leave on the 17th) and will not be back in California until Feb. 4th and then I'll be jumping into a new semester. So feel free to take your time looking over the patches. Peace - Anthony
Hide
Anthony Borrow added a comment -

Wen - Did you find any reason for me not to use the patches to backup graded events for the GBPv2 patch? I know that you are now working with 1.9 code so let me know if you do not have time for further testing. I am OK with just leaving them in GBPv2 HEAD and never putting them in 18STABLE. I will hopefully be doing a bit of refactoring to handle some of the other issues and will leave most of that work in HEAD in case I introduce a regression. I think this will be OK especially as we hopefully approach end-of-life for GBPv2 in favor of 1.9. Peace - Anthony

Show
Anthony Borrow added a comment - Wen - Did you find any reason for me not to use the patches to backup graded events for the GBPv2 patch? I know that you are now working with 1.9 code so let me know if you do not have time for further testing. I am OK with just leaving them in GBPv2 HEAD and never putting them in 18STABLE. I will hopefully be doing a bit of refactoring to handle some of the other issues and will leave most of that work in HEAD in case I introduce a regression. I think this will be OK especially as we hopefully approach end-of-life for GBPv2 in favor of 1.9. Peace - Anthony
Hide
Anthony Borrow added a comment -

Having heard no objection, I am going to mark this issue as resolved. To fix the issue, GBPv2 users should download the latest version (not the 1.8 version). The latest version is from HEAD and the 1.8 version is 18STABLE. If there are problems with the patch please let me know so that we can re-open this issue. Peace - Anthony

Show
Anthony Borrow added a comment - Having heard no objection, I am going to mark this issue as resolved. To fix the issue, GBPv2 users should download the latest version (not the 1.8 version). The latest version is from HEAD and the 1.8 version is 18STABLE. If there are problems with the patch please let me know so that we can re-open this issue. Peace - Anthony
Hide
Anthony Borrow added a comment -

Resolving this issue. Changes for the issue will remain in HEAD for GBPv2 patch and not be merged back to 18STABLE. I have had less time to test these changes and will be using the 18STABLE branch in case there are regressions. I did not want to mess up otherwise functioning sites but did want to provide a possible fix. The hope is that all GBPv2 users will upgrade to Moodle 1.9 so that GBPv2 can become obsolete. Peace - Anthony

Show
Anthony Borrow added a comment - Resolving this issue. Changes for the issue will remain in HEAD for GBPv2 patch and not be merged back to 18STABLE. I have had less time to test these changes and will be using the 18STABLE branch in case there are regressions. I did not want to mess up otherwise functioning sites but did want to provide a possible fix. The hope is that all GBPv2 users will upgrade to Moodle 1.9 so that GBPv2 can become obsolete. Peace - Anthony
Hide
Anthony Borrow added a comment -

Closing all of my resolved issues. Peace - Anthony

Show
Anthony Borrow added a comment - Closing all of my resolved issues. Peace - Anthony

People

Vote (1)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: