[OzzModz] Sequential Stickies

[OzzModz] Sequential Stickies 2.0.1 Patch Level 2

No permission to download
It appears the above is as designed. Even if I have four stickies, numbered 1 - 4, and I stick a new thread with a order of 15, the actual orded number ends up being 5.

Turns out that there is some sort of issue with the numbering. I’ve created 10+ stickies and it does not save it as the number I entered, like if I have 11 stickies already, and set a new one as 12, it actually saves it as 5 (or some random number), which is really odd. Going to be a bit to figure this out.
disney anniversary GIF by Mickey Mouse
 
It is happening on stickies ordered larger than position 10 because I used strcmp on integers for some reason in function fetchSequencesByIds
You'll have to change that function to:
PHP:
public function fetchSequencesByIds(array $ids)
{
    if (!$ids)
    {
        return $this->em->getEmptyCollection();
    }
    
    function sortOrder($a, $b)
    {
        if ($a == $b)
        {
            return 0;
        }
        return ($a < $b) ? -1 : 1;
    }
    
    $sequences = $this->em->findByIds('Bespoke\SequentialStickies:Sequence', $ids)->toArray();
    usort($sequences, function ($a, $b) { return sortOrder($a['sequence_order'], $b['sequence_order']); });
    return $sequences;
}
 
@Ozzy47, Hi, if there are 20 or more fixed topics in a section, then after sorting they are in the right place for the day. Then they randomly change their location and numbers. At the same time, new messages were written only in two topics, and these topics are not at the top of the list.
XenForo 2.2.5
 
When use forum view filter and apply "sort by" option.

Fatal error: Cannot redeclare Bespoke\SequentialStickies\Repository\sortOrder() (previously declared in /home/edewan/public_html/forum/src/addons/Bespoke/SequentialStickies/Repository/Sequence.php:31) in /home/edewan/public_html/forum/src/addons/Bespoke/SequentialStickies/Repository/Sequence.php on line 31

XenForo 2.2.6
 
Ozzy47 updated [OzzModz] Sequential Stickies with a new update entry:

[OzzModz] Sequential Stickies for XenForo 2.1+ Update 2.0.1 Patch Level 1

Potential fix for, Fatal error: Cannot redeclare Bespoke\SequentialStickies\Repository\sortOrder() (previously declared in /home/edewan/public_html/forum/src/addons/Bespoke/SequentialStickies/Repository/Sequence.php:31) in /home/******/public_html/forum/src/addons/Bespoke/SequentialStickies/Repository/Sequence.php on line 31

Read the rest of this update entry...
 
Been having issues moving threads with this addon. Not sure what's going on.

Stack Trace:
Code:
#0 src/addons/Bespoke/SequentialStickies/Listener.php(78): XF\Mvc\Entity\Entity->getPreviousValue('node_id')
#1 src/XF/Extension.php(52): Bespoke\SequentialStickies\Listener::threadEntityPostSave(Object(Bespoke\SequentialStickies\Entity\Sequence))
#2 src/XF.php(966): XF\Extension->fire('entity_post_sav...', Array, 'XF\\Entity\\Threa...')
#3 src/XF/Mvc/Entity/Entity.php(1276): XF::fire('entity_post_sav...', Array, 'XF\\Entity\\Threa...')
#4 src/XF/Service/Thread/Mover.php(116): XF\Mvc\Entity\Entity->save(true, false)
#5 src/XF/Pub/Controller/Thread.php(1236): XF\Service\Thread\Mover->move(Object(XFMG\XF\Entity\Forum))
#6 src/XF/Mvc/Dispatcher.php(352): XF\Pub\Controller\Thread->actionMove(Object(XF\Mvc\ParameterBag))
#7 src/XF/Mvc/Dispatcher.php(259): XF\Mvc\Dispatcher->dispatchClass('XF:Thread', 'Move', Object(XF\Mvc\RouteMatch), Object(SV\AlertImprovements\XF\Pub\Controller\Thread), NULL)
#8 src/XF/Mvc/Dispatcher.php(115): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\AlertImprovements\XF\Pub\Controller\Thread), NULL)
#9 src/XF/Mvc/Dispatcher.php(57): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#10 src/XF/App.php(2352): XF\Mvc\Dispatcher->run()
#11 src/XF.php(524): XF\App->run()
#12 index.php(20): XF::runApp('XF\\Pub\\App')
#13 {main}

Request State:
Code:
array(4) {
  ["url"] => string(9) "/faq/move"
  ["referrer"] => string(30) "https://mesozoichaven.com/faq/"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(9) {
    ["_xfToken"] => string(8) "********"
    ["prefix_id"] => string(1) "0"
    ["title"] => string(26) "Frequently Asked Questions"
    ["target_node_id"] => string(2) "44"
    ["redirect_type"] => string(9) "permanent"
    ["notify_watchers"] => string(1) "1"
    ["_xfRequestUri"] => string(5) "/faq/"
    ["_xfWithData"] => string(1) "1"
    ["_xfResponseType"] => string(4) "json"
  }
}
 
Top Bottom