24hoursmedia-craftcms / views-work

Craft CMS views plugin
Other
1 stars 2 forks source link

orderByPopular doesn't order correctly #107

Closed mijewe closed 1 year ago

mijewe commented 1 year ago

I'm ordering by entries using .orderByPopular('total', 0) as per the docs, but the order doesn't appear to be by most popular.

    {% set results = craft.entries.orderByPopular('total', 0).all() %}

    {% for result in results %}
        <li>{{ result.title }} ({{ result.viewsWork.total }})</li>
    {% endfor %}

returns (for example)

entry one (8)
entry two (12)
entry three (0)
entry four (3)

I'm using: Craft 4.5.6 MariaDB 10.11.4 Views Work 2.1.2

davorpeic commented 1 year ago

@mijewe Aren't you missing section?

mijewe commented 1 year ago

I was using the most minimal example I could to illustrate the point.

With or without a section parameter, it should still be returning results in order of most popular

mijewe commented 1 year ago

Hi :)

any update on this? This feels like a pretty fundamental aspect of the plugin.

Or I'm missing something

24hoursmedia-craftcms commented 1 year ago

Hi :) Sorry it is kind of busy with Black Friday.

I am currently looking into it, I can reproduce the issue and come back to it soon!

24hoursmedia-craftcms commented 1 year ago

Thank you for the report, the issues was introduced in another release with multisite support and escaped testing. It should be fixed in 2.1.3 (just released).