aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2019-02-24 11:30:35 +0100
committerGitHub <noreply@github.com>2019-02-24 11:30:35 +0100
commitc21dcc8199ff3bfe8d7eac705d53a45408537c3c (patch)
tree6e501b3bb243d02aba116eac1d5f498de2f2122e
parent015314f3c6a1ce0b2c45fdb2fb0d36a15cab10f5 (diff)
parentb790f900c937d0d8f6eccc15d2b4c26023f3d276 (diff)
downloadShaarli-c21dcc8199ff3bfe8d7eac705d53a45408537c3c.tar.gz
Shaarli-c21dcc8199ff3bfe8d7eac705d53a45408537c3c.tar.zst
Shaarli-c21dcc8199ff3bfe8d7eac705d53a45408537c3c.zip
Merge pull request #1270 from ArthurHoaro/hotfix/sticky-warning
Fix a warning if links sticky status isn't set
-rw-r--r--application/bookmark/LinkDB.php6
-rw-r--r--index.php2
2 files changed, 7 insertions, 1 deletions
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
252 ), 252 ),
253 'private' => 0, 253 'private' => 0,
254 'created' => new DateTime(), 254 'created' => new DateTime(),
255 'tags' => 'opensource software' 255 'tags' => 'opensource software',
256 'sticky' => false,
256 ); 257 );
257 $link['shorturl'] = link_small_hash($link['created'], $link['id']); 258 $link['shorturl'] = link_small_hash($link['created'], $link['id']);
258 $this->links[1] = $link; 259 $this->links[1] = $link;
@@ -265,6 +266,7 @@ You use the community supported version of the original Shaarli project, by Seba
265 'private' => 1, 266 'private' => 1,
266 'created' => new DateTime('1 minute ago'), 267 'created' => new DateTime('1 minute ago'),
267 'tags' => 'secretstuff', 268 'tags' => 'secretstuff',
269 'sticky' => false,
268 ); 270 );
269 $link['shorturl'] = link_small_hash($link['created'], $link['id']); 271 $link['shorturl'] = link_small_hash($link['created'], $link['id']);
270 $this->links[0] = $link; 272 $this->links[0] = $link;
@@ -306,6 +308,8 @@ You use the community supported version of the original Shaarli project, by Seba
306 308
307 $link['real_url'] = $link['url']; 309 $link['real_url'] = $link['url'];
308 310
311 $link['sticky'] = isset($link['sticky']) ? $link['sticky'] : false;
312
309 // To be able to load links before running the update, and prepare the update 313 // To be able to load links before running the update, and prepare the update
310 if (!isset($link['created'])) { 314 if (!isset($link['created'])) {
311 $link['id'] = $link['linkdate']; 315 $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,
1171 $link['thumbnail'] = $thumbnailer->get($url); 1171 $link['thumbnail'] = $thumbnailer->get($url);
1172 } 1172 }
1173 1173
1174 $link['sticky'] = isset($link['sticky']) ? $link['sticky'] : false;
1175
1174 $pluginManager->executeHooks('save_link', $link); 1176 $pluginManager->executeHooks('save_link', $link);
1175 1177
1176 $LINKSDB[$id] = $link; 1178 $LINKSDB[$id] = $link;