Duplicate Trending/Featured widgets: Context is lost

DragonByte Tech

Well-known member
Licensed customer
Affected version
2.3.12
If you toggle the "Contextual" flag on for the Trending or Featured widgets, the filtering does not work according to what you'd expect, at least not on PHP 8.3/8.4. Unsure about earlier PHP versions.

Debug Code:
PHP:
        $finder = $featureRepo->findFeaturedContent();
        $filters = $this->getFilters();

        \XF::dump($options);
        \XF::dump($this->options);
        die();

        $this->applyFilters($finder, $filters);

Output:
1785516097040.webp

Problem:
getFilters() reads $this->options but the content_container_id is only set for a local $options variable.

Solution(s):
Either getFilters() should accept the $options array, or (ideally) all instances of the local $options variable should be removed from render().
 
Automated triage: Duplicate

Thanks for the clear analysis. This is the same problem as an existing open report about contextual filtering in the Featured content widget, so we'll track it there. In our code, the Trending content widget applies its context correctly.

Duplicate of: https://xenforo.com/community/threads/235763/

This is an automated assessment. A member of staff may review and update it.
 
Back
Top Bottom