Skip to content

Commit

Permalink
Fixes (circumvents) problem migrating filedownloads and updates phras…
Browse files Browse the repository at this point in the history
…es in some migration templates
  • Loading branch information
dleffler authored and Phillip Ball committed Mar 18, 2011
1 parent 905eb38 commit 703f0d4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
12 changes: 7 additions & 5 deletions framework/modules/migration/controllers/migrationController.php
Expand Up @@ -744,24 +744,26 @@ private function convert($iloc, $module, $hc=0) {
foreach ($resourceitems as $ri) {
unset($ri['id']);
$filedownload = new filedownload($ri);
$filedownload->makeSefUrl();
// $filedownload->makeSefUrl();
$loc = expUnserialize($ri['location_data']);
$loc->mod = "filedownload";
$filedownload->title = $ri['name'];
$filedownload->body = $ri['description'];
$filedownload->downloads = $ri['num_downloads'];
$filedownload->location_data = serialize($loc);
// $filedownload->created_at = $ri['posted'];
// $filedownload->edited_at = $ri['edited'];
$filedownload->save();
// default is to create with current time
$filedownload->created_at = $ri['posted'];
$filedownload->edited_at = $ri['edited'];
$filedownload->update();
@$this->msg['migrated'][$iloc->mod]['count']++;
@$this->msg['migrated'][$iloc->mod]['name'] = $this->new_modules[$iloc->mod];
if (!empty($ri['file_id'])) {
$oldfile = $old_db->selectArray('file', 'id='.$ri['file_id']);
$file = new expFile($oldfile);
$filedownload->attachitem($file,'downloadable');
// default is to create with current time
$filedownload->created_at = $ri['posted'];
$filedownload->edited_at = $ri['edited'];
// $filedownload->update();
}
}
}
Expand Down
Expand Up @@ -49,7 +49,7 @@
{/foreach}
</tbody>
</table>
{control type="checkbox" name="wipe_pages" label="Erase all current pages then import?" value=1 checked=false}
{control type="checkbox" name="wipe_pages" label="Erase all current pages then try again?" value=1 checked=false}
{control type="buttongroup" submit="Migrate Pages" cancel="Cancel"}
{/form}
</div>
Expand Up @@ -19,9 +19,9 @@
<tr class="{cycle values="odd,even"}">
<td>
{if $key == $val.name}
<strong>{$val.count}</strong> record{if $val.count>1}s{/if} from <strong>{$key}</strong> have been migrated as is</strong>
<strong>{$val.count}</strong> record{if $val.count==1}s{/if} from <strong>{$key}</strong> {if $val.count==1}have{else}has{/if} been migrated as is</strong>
{else}
<strong>{$val.count}</strong> record{if $val.count>1}s{/if} from <strong>{$key}</strong> have been migrated to <strong>{$val.name}</strong>
<strong>{$val.count}</strong> record{if $val.count==1}s{/if} from <strong>{$key}</strong> {if $val.count==1}have{else}has{/if} been migrated to <strong>{$val.name}</strong>
{/if}
</td>
</tr>
Expand Down

0 comments on commit 703f0d4

Please sign in to comment.