From: ArthurHoaro Date: Sun, 24 Feb 2019 10:30:35 +0000 (+0100) Subject: Merge pull request #1270 from ArthurHoaro/hotfix/sticky-warning X-Git-Tag: v0.11.0~31 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=c21dcc8199ff3bfe8d7eac705d53a45408537c3c;hp=015314f3c6a1ce0b2c45fdb2fb0d36a15cab10f5;p=github%2Fshaarli%2FShaarli.git Merge pull request #1270 from ArthurHoaro/hotfix/sticky-warning Fix a warning if links sticky status isn't set --- diff --git a/application/bookmark/LinkDB.php b/application/bookmark/LinkDB.php index 266632e3..efde8468 100644 --- a/application/bookmark/LinkDB.php +++ b/application/bookmark/LinkDB.php @@ -252,7 +252,8 @@ You use the community supported version of the original Shaarli project, by Seba ), 'private' => 0, 'created' => new DateTime(), - 'tags' => 'opensource software' + 'tags' => 'opensource software', + 'sticky' => false, ); $link['shorturl'] = link_small_hash($link['created'], $link['id']); $this->links[1] = $link; @@ -265,6 +266,7 @@ You use the community supported version of the original Shaarli project, by Seba 'private' => 1, 'created' => new DateTime('1 minute ago'), 'tags' => 'secretstuff', + 'sticky' => false, ); $link['shorturl'] = link_small_hash($link['created'], $link['id']); $this->links[0] = $link; @@ -306,6 +308,8 @@ You use the community supported version of the original Shaarli project, by Seba $link['real_url'] = $link['url']; + $link['sticky'] = isset($link['sticky']) ? $link['sticky'] : false; + // To be able to load links before running the update, and prepare the update if (!isset($link['created'])) { $link['id'] = $link['linkdate']; diff --git a/index.php b/index.php index 9ea26c7c..3700504b 100644 --- a/index.php +++ b/index.php @@ -1171,6 +1171,8 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager, $link['thumbnail'] = $thumbnailer->get($url); } + $link['sticky'] = isset($link['sticky']) ? $link['sticky'] : false; + $pluginManager->executeHooks('save_link', $link); $LINKSDB[$id] = $link;