Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 294800

EntityFieldQuery::range is not resetting when NULL is passed

$
0
0

According to the documentation for EntityFieldQuery::range if you pass NULL as argument, the range directive gets removed.
This is not working as expected. It is not removing the range directive, it is just setting the $start and $length values as NULL.

To reproduce, construct a query as normal, including a range(0,10) condition. Then, set range(NULL, NULL) - or just range() - and execute again.

In entity.inc line 1314, it checks if ($this->range) - which in this case would result in:

range = array(
  'start' => NULL,
  'length' => NULL,
)
being evaluated as true.

Should the range() function not check if ($start === NULL) before assigning the arguments to the object property? Alternatively, finishQuery() needs to check the individual elements instead of the array.


Viewing all articles
Browse latest Browse all 294800

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>