Skip to content

Commit

Permalink
if we know the share is not found, don't attempt to tag it
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Apr 8, 2011
1 parent c9e504b commit caa4e05
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions kronolith/migration/18_kronolith_upgrade_categoriestotags.php
Expand Up @@ -46,17 +46,16 @@ public function up()
// Do we need to tag the event again, but as the share owner?
try {
$cal = $this->_shares->getShare($row['calendar_id']);
if ($cal->get('owner') != $row['event_creator_id']) {
$this->_tagger->tag(
$cal->get('owner'),
array('object' => $row['event_uid'], 'type' => $this->_type_ids['event']),
Horde_String::convertCharset($row['event_category'], $this->getOption('charset'), 'UTF-8')
);
}
} catch (Exception $e) {
$this->announce('Unable to find Share: ' . $row['calendar_id'] . ' Skipping.');
}

if ($cal->get('owner') != $row['event_creator_id']) {
$this->_tagger->tag(
$cal->get('owner'),
array('object' => $row['event_uid'], 'type' => $this->_type_ids['event']),
Horde_String::convertCharset($row['event_category'], $this->getOption('charset'), 'UTF-8')
);
}
}
$this->announce('Event categories successfully migrated.');
$this->removeColumn('kronolith_events', 'event_category');
Expand Down

0 comments on commit caa4e05

Please sign in to comment.