Repository: picocms/Pico (language: php)

Issue:
Wrong config keys in `discoverPageSiblings`
Rest of the code use `pages_order` and `pages_order_by` keys.

https://github.com/picocms/Pico/blob/09aa82578710d82dd7dc482febe32991be0ea307/lib/Pico.php#L1889


Discussion / hints:
Good catch! :+1: A pull request on the `pico-3.0` branch (even though it's clearly a bug, it still is a breaking change: people likely circumvented it by other means already) is very welcome.

Fix patch:
diff --git a/lib/Pico.php b/lib/Pico.php
index 653380f3..f820065c 100644
--- a/lib/Pico.php
+++ b/lib/Pico.php
@@ -1940,7 +1940,7 @@ protected function sortPages(): void
      */
     protected function discoverPageSiblings(): void
     {
-        if (($this->getConfig('order_by') === 'date') && ($this->getConfig('order') === 'desc')) {
+        if (($this->getConfig('pages_order_by') === 'date') && ($this->getConfig('pages_order') === 'desc')) {
             $precedingPageKey = 'next_page';
             $succeedingPageKey = 'previous_page';
         } else {


Test patch: