From: Evan Prodromou Date: Thu, 31 Mar 2011 15:20:24 +0000 (-0400) Subject: If Router is mucked up, force URI for Bookmark X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2411caa000a490b9afce2398fefb4110e92e0f11;p=quix0rs-gnu-social.git If Router is mucked up, force URI for Bookmark --- diff --git a/plugins/Bookmark/Bookmark.php b/plugins/Bookmark/Bookmark.php index 777b50f724..48709d1387 100644 --- a/plugins/Bookmark/Bookmark.php +++ b/plugins/Bookmark/Bookmark.php @@ -238,8 +238,23 @@ class Bookmark extends Memcached_DataObject if (array_key_exists('uri', $options)) { $nb->uri = $options['uri']; } else { - $nb->uri = common_local_url('showbookmark', - array('id' => $nb->id)); + // FIXME: hacks to work around router bugs in + // queue daemons + + $r = Router::get(); + + $path = $r->build('showbookmark', + array('id' => $nb->id)); + + if (empty($path)) { + $nb->uri = common_path('bookmark/'.$nb->id, false, false); + } else { + $nb->uri = common_local_url('showbookmark', + array('id' => $nb->id), + null, + null, + false); + } } $nb->insert();