Author: david
Date: Mon Aug 22 17:28:29 2011
New Revision: 9563

Log:
Use repository slug in path instead of id.  Shorten 'repo' dir to 'r'

Modified:
   trunk/lib/model/QubitDigitalObject.php
   trunk/lib/task/migrate/QubitMigrate110.class.php

Modified: trunk/lib/model/QubitDigitalObject.php
==============================================================================
--- trunk/lib/model/QubitDigitalObject.php      Mon Aug 22 17:24:18 2011        
(r9562)
+++ trunk/lib/model/QubitDigitalObject.php      Mon Aug 22 17:28:29 2011        
(r9563)
@@ -778,14 +778,14 @@
     $repoDir = '';
     if (null !== ($repo = $infoObject->getRepository(array('inherit' => 
true))))
     {
-      $repoDir = $repo->id;
+      $repoDir = $repo->slug;
     }
     else
     {
       $repoDir = 'null';
     }
 
-    return 
'/'.sfConfig::get('app_upload_dir').'/repo/'.$repoDir.'/'.$id[0].'/'.$id[1].'/'.$id;
+    return 
'/'.sfConfig::get('app_upload_dir').'/r/'.$repoDir.'/'.$id[0].'/'.$id[1].'/'.$id;
   }
 
   /**

Modified: trunk/lib/task/migrate/QubitMigrate110.class.php
==============================================================================
--- trunk/lib/task/migrate/QubitMigrate110.class.php    Mon Aug 22 17:24:18 
2011        (r9562)
+++ trunk/lib/task/migrate/QubitMigrate110.class.php    Mon Aug 22 17:28:29 
2011        (r9563)
@@ -626,14 +626,14 @@
       $repo = $this->getRowByKeyOrId('QubitRepository', 
$infoObject['repository_id']);
 
       // Update path
-      $item['path'] = str_replace('uploads', 'uploads/repo/'.$repo['_key'], 
$item['path']);
+      $item['path'] = str_replace('uploads', 'uploads/repo/'.$repo['slug'], 
$item['path']);
 
       // Update derivative paths
       foreach ($this->data['QubitDigitalObject'] as $key2 => &$item2)
       {
         if (isset($item2['parent_id']) && $key == $item2['parent_id'])
         {
-          $item2['path'] = str_replace('uploads', 
'uploads/repo/'.$repo['_key'], $item2['path']);
+          $item2['path'] = str_replace('uploads', 
'uploads/repo/'.$repo['slug'], $item2['path']);
         }
       }
     }

-- 
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/qubit-commits?hl=en.

Reply via email to