Moodle

Post date information is lost during backup and restore of forums

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.7.2
  • Fix Version/s: 1.7.3, 1.8.3, 1.9
  • Component/s: Backup, Forum
  • Labels:
    None
  • Database:
    MySQL
  • Affected Branches:
    MOODLE_17_STABLE
  • Fixed Branches:
    MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE

Description

When forums are backed up and restored in a new course the posting date information is lost.

All posts are reset to have been posted on Wed, 31 Dec 1969, 07:00 PM (presumably the date field is empty or set to 0).

Issue Links

Activity

Hide
Michael E. Gage added a comment -

In this case i was moving forums from the front page (course id =1) to another course. This may be a special case which does not occur
when moving forums from one regular course to another.

The issue goes away if I comment out the lines such as:

$post->modified += $restore->course_startdateoffset; in forums/restorelib.php

leading me to believe that $restore->course_startdateoffset hasn't been set properly and that
there is no check to insure that it is correctly defined.

Show
Michael E. Gage added a comment - In this case i was moving forums from the front page (course id =1) to another course. This may be a special case which does not occur when moving forums from one regular course to another. The issue goes away if I comment out the lines such as: $post->modified += $restore->course_startdateoffset; in forums/restorelib.php leading me to believe that $restore->course_startdateoffset hasn't been set properly and that there is no check to insure that it is correctly defined.
Hide
Eloy Lafuente (stronk7) added a comment -

Hi Michael,

that's really strange as this type of lines:

$post->modified += $restore->course_startdateoffset;

seems to work properly, no matter if $restore->course_startdateoffset is set, not set, undefined, null or 0. The results is my tests are that 0 is added in all the previous cases. I've tested that both under PHP4 and PHP5.

Could it be possible for you to send me one small backup file (that is not working in your server) to be able to reproduce the problem here? Perhaps the bug is in backup...uhm...

If you can, please, send it to me privately, I'll use it in my dev-box and destroy it after test, of course!

TIA and ciao, Eloy

Show
Eloy Lafuente (stronk7) added a comment - Hi Michael, that's really strange as this type of lines: $post->modified += $restore->course_startdateoffset; seems to work properly, no matter if $restore->course_startdateoffset is set, not set, undefined, null or 0. The results is my tests are that 0 is added in all the previous cases. I've tested that both under PHP4 and PHP5. Could it be possible for you to send me one small backup file (that is not working in your server) to be able to reproduce the problem here? Perhaps the bug is in backup...uhm... If you can, please, send it to me privately, I'll use it in my dev-box and destroy it after test, of course! TIA and ciao, Eloy
Hide
Eloy Lafuente (stronk7) added a comment -

Any advance here?

Show
Eloy Lafuente (stronk7) added a comment - Any advance here?
Hide
Eloy Lafuente (stronk7) added a comment -

Thanks to one backup file sent by Domingo Gallardo I've been able to trace this issue.

It affected seriously to all the course backups whose format doesn't allow the course start date to be defined (site course page, social format courses...).

It should be fixed and working now for 1.7.2+, 1.8.2+ and 1.9beta.

Thanks and ciao

Show
Eloy Lafuente (stronk7) added a comment - Thanks to one backup file sent by Domingo Gallardo I've been able to trace this issue. It affected seriously to all the course backups whose format doesn't allow the course start date to be defined (site course page, social format courses...). It should be fixed and working now for 1.7.2+, 1.8.2+ and 1.9beta. Thanks and ciao

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: