Bolt: getContent always returns something

Created on 24 Aug 2017  路  3Comments  路  Source: bolt/bolt

Using the query service provider, the getContent always returns a result when it shouldn't.

Details

  • Relevant Bolt Version: 3.3.2
  • Install type: Composer install
  • PHP version: 7.1.6
  • Used web server: Apache 2.4

Reproduction

  1. Bug summary:

Tried to query some content type with a where clause on an id parameter. When the id parameter is null or false, the query still returns something.

  1. Steps to reproduce:
$this->app['query']->getContent('pages', [
    'id'           => false,
])
  1. Expected result:

No results

  1. Actual result:

Always returns some "fallback" results

bug

All 3 comments

I'll let @rossriley confirm, but my understanding of the intent of design is to match Doctrine, and always return a result set, empty or otherwise, unless it is a single record request.

This behaviour still applies on:

$this->app['query']->getContent('pages', [
    'id'           => false,
    'returnsingle' => true,
]);

Fixed in #7110

Was this page helpful?
0 / 5 - 0 ratings

Related issues

develth picture develth  路  5Comments

diskoflorian picture diskoflorian  路  5Comments

GwendolenLynch picture GwendolenLynch  路  5Comments

xiaohutai picture xiaohutai  路  5Comments

jadwigo picture jadwigo  路  4Comments