BackupMODX icon indicating copy to clipboard operation
BackupMODX copied to clipboard

Incorrect date label in restore

Open Lefthandmedia opened this issue 6 years ago • 2 comments

When restoring a bakup i'm presented with a list of possible backups i can choose. These bakups are labbeled by there date. However after FTP'ing an update file the modification date is changed. On inspection i found that the date for this label is created in Backupmodx.class.php on #208. Here the modification time of the containing folder (filemtime($this->targetPath . $folder)) is used to create the label. This should be done based on the NAME of the folder not the modification date of the folder

Lefthandmedia avatar Jul 03 '19 09:07 Lefthandmedia

i corrected this by adding an explode on the folder name:

			$labeldate   = date_create_from_format( 'Y-m-d His', $labels[0] . ' ' . $labels[1] );
			$date_format = date_format( $labeldate, 'F d Y - H:i a' );
			$backups[] = array(
				'name'        => $folder,
				'path'        => $this->targetPath,
				'date'        => filemtime( $this->targetPath . $folder ),
				'date_format' => $date_format,
				'note'        => $note,
				'files'       => $files,
			);

Lefthandmedia avatar Jul 03 '19 10:07 Lefthandmedia

This has to be changed in this code part now: https://github.com/jdaehne/BackupMODX/blob/master/core/components/backupmodx/src/BackupMODX.php#L193-L202

Jako avatar Sep 22 '19 21:09 Jako