forked from GNUsocial/gnu-social
If Router is mucked up, force URI for Bookmark
This commit is contained in:
parent
347b57f72a
commit
2411caa000
@ -238,8 +238,23 @@ class Bookmark extends Memcached_DataObject
|
|||||||
if (array_key_exists('uri', $options)) {
|
if (array_key_exists('uri', $options)) {
|
||||||
$nb->uri = $options['uri'];
|
$nb->uri = $options['uri'];
|
||||||
} else {
|
} else {
|
||||||
$nb->uri = common_local_url('showbookmark',
|
// FIXME: hacks to work around router bugs in
|
||||||
array('id' => $nb->id));
|
// 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();
|
$nb->insert();
|
||||||
|
Loading…
Reference in New Issue
Block a user