Giter Site home page Giter Site logo

Comments (4)

brandonkelly avatar brandonkelly commented on July 22, 2024 1

Craft 4.9.5 and 5.1.5 are out with a fix that covers both of these issues. Thanks for reporting!

from cms.

yannkost avatar yannkost commented on July 22, 2024

I have also noticed that the .count() function does not return the right value for some queries.

{% set searchQuery = craft.entries({ type: availableEntryTypes}).search(query).orderBy('score').limit(5) %}

This sample code does return the limit of 5 and not the number of the entries.

from cms.

yannkost avatar yannkost commented on July 22, 2024

Just checked and without the orderBy('score') the function call returns the correct number.

from cms.

i-just avatar i-just commented on July 22, 2024

@myleshyson, in your case, the EntryQuery::EVENT_BEFORE_PREPARE used to rely on the $event->sender->orderBy returning null, but since 4.9, it’s returning an empty string.

@yannkost, in your case, it’s the combination of search, limit and orderBy('score').

I raised a draft PR, and we’ll discuss this internally.

from cms.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.