Fix bookmarks migration provider

remotes/origin/stable4
Tom Needham 2012-03-27 21:35:29 +07:00
parent ef33219e4f
commit bd4fd76bfb
2 changed files with 10 additions and 5 deletions

@ -48,9 +48,9 @@ class OC_Migration_Provider_Bookmarks extends OC_Migration_Provider{
}
// Now tags
foreach($idmap as $oldid => $newid){
$query = $this->content->prepare( "SELECT * FROM bookmarks_tags WHERE user_id LIKE ?" );
$query = $this->content->prepare( "SELECT * FROM bookmarks_tags WHERE bookmark_id LIKE ?" );
$results = $query->execute( array( $oldid ) );
while( $row = $data->fetchRow() ){
while( $row = $results->fetchRow() ){
// Import the tags for this bookmark, using the new bookmark id
$query = OC_DB::prepare( "INSERT INTO *PREFIX*bookmarks_tags(bookmark_id, tag) VALUES (?, ?)" );
$query->execute( array( $newid, $row['tag'] ) );

@ -54,11 +54,16 @@ if (isset($_POST['user_import'])) {
}
}
}
die(print_r($notsupported));
die( 'Some apps failed to import, or were not supported.' );
// Any problems?
if( isset( $notsupported ) || isset( $failed ) ){
if( count( $failed ) > 0 ){
die( 'Some apps failed to import. View the log please.' );
} else if( count( $notsupported ) > 0 ){
die( 'Some apps were not found in this owncloud instance and therefore could not be installed' );
}
}
}
} else {
// fill template
$tmpl = new OC_Template('user_migrate', 'admin');