]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Merge pull request #1270 from ArthurHoaro/hotfix/sticky-warning
authorArthurHoaro <arthur@hoa.ro>
Sun, 24 Feb 2019 10:30:35 +0000 (11:30 +0100)
committerGitHub <noreply@github.com>
Sun, 24 Feb 2019 10:30:35 +0000 (11:30 +0100)
Fix a warning if links sticky status isn't set

application/bookmark/LinkDB.php
index.php

index 266632e30da3ed45a0015dbcfc278878809e80e1..efde8468fca97e896f1da161e444993bdd711b4d 100644 (file)
@@ -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'];
index 9ea26c7c5f67a09d8d2ab0d115863d44bd324de6..3700504b8a9e86422b1570a315b76c207daa35b8 100644 (file)
--- 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;