Support from Acquia helps fund testing for Drupal Acquia logo

Comments

loganfsmyth’s picture

Status: Active » Needs review
FileSize
676 bytes

Here's the quick fix, since it's only used in one place.

This is also an issue with D7.

chx’s picture

Status: Needs review » Needs work

The last submitted patch, efq-ordered-results-case-1292930-1.patch, failed testing.

bxtaylor’s picture

Status: Needs work » Needs review
FileSize
784 bytes

Rolled this against latest code. Location of the file has changed since OP.

chx’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

Thanks for the reroll, could you please amend existing tests to check for this?

bxtaylor’s picture

I'd love to, although I'll need a little guidance - it'll be the first tests I've written.

I'll take a few days to catch up on testing documentation and get back to this. Seems to be no rush here.

My first question, though: am I looking to amend EntityFieldQuery.php?

Thanks, chx.

bxtaylor’s picture

Err, I mean EntityFieldQueryTest.php.

chx’s picture

Yes, you are in the right file, I would probably patch up assertEntityFieldQuery.

disasm’s picture

Status: Needs work » Needs review
FileSize
546 bytes

Here's a reroll. The functionality of ordered_results has since changed to be ids instead of partial_entities. Tests coming soon...

Status: Needs review » Needs work
Issue tags: -Needs tests

The last submitted patch, drupal-efq_ordered_results-1292930-9.patch, failed testing.

ACF’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work
Issue tags: +Needs tests

The last submitted patch, drupal-efq_ordered_results-1292930-9.patch, failed testing.

ACF’s picture

Status: Needs work » Needs review
FileSize
506 bytes

Just a reroll.

Status: Needs review » Needs work
Issue tags: -Needs tests

The last submitted patch, 1292930-ordered_results-drupal_efq-13.patch, failed testing.

disasm’s picture

Status: Needs work » Needs review
Issue tags: +Needs tests
disasm’s picture

attached is a patch with a test that verifies $orderedResults is not empty after running execute on an EntityFieldQuery with an entityOrderBy called prior to execute.

Berdir’s picture

The last submitted patch, 16: drupal-ordered_results-1292930-16.patch, failed testing.

David_Rothstein’s picture

Issue summary: View changes

I just marked #2239355: pointless assignment in EntityFieldQuery::finishQuery() as a duplicate.

A couple quick comments on the patch:
- Since $this->ordered_results already exists (and is a public property by default) shouldn't we leave it around as a duplicate of $this->orderedResults for backwards compatibility? (And document it as a property on the class also.)
- It would be better if the test verified that the contents of $query->orderedResults were actually correct (i.e. in the correct order) rather than just that the variable is non-empty.

Berdir’s picture

Status: Needs review » Needs work
Issue tags: -Needs tests +Needs reroll, +Novice
Rok Žlender’s picture

Is this still a valid issue? I couldn't find any mention of ordered_results in 8.0.x or anything similar to ordered_results.

mfernea’s picture

Status: Needs work » Closed (cannot reproduce)
Issue tags: -Needs reroll +Amsterdam2014

I also think that this issue is no longer relevant. No occurences of "ordered_results" in code.

Derimagia’s picture

Version: 8.0.x-dev » 7.x-dev
Status: Closed (cannot reproduce) » Needs review

This is still an issue in Drupal 7.x core. It's a typo in a variable name, but some people may be using ordered_results instead of orderedResults, since it's a typo in the code. Documentation for it still says it's orderedResults. I don't see why we don't fix this, since it's an obvious typo in either the code or the documentation. Or is there another bug for this?

(EntityFieldQuery::execute)
* After executing the query, $this->orderedResults will contain a list of
* the same stub entities in the order returned by the query. This is only
* relevant if there are multiple entity types in the returned value and
* a field ordering was requested. In every other case, the returned value
* contains everything necessary for processing.

sosyuki’s picture

Because some people using ordered_results in code.

stefan.r’s picture

Issue tags: -Novice
Derimagia’s picture

@sosyuki not really that good of an excuse. orderedResults never would have worked so changing the comment and the official way to "ordered_results" (or both) would be the fix.

poker10’s picture

This is throwing a deprecated message on PHP 8.2:

exception: [Deprecated] Line 1399 of includes/entity.inc:
Creation of dynamic property EntityFieldQuery::$ordered_results is deprecated

I think we need to update the execute() function doc block and rename the public property $orderedResults (which never worked and it is always empty) to $ordered_results.

poker10’s picture

Uploading the patch with this approach. I do not think we can do the opposite, as people are already using the $ordered_results in the code, so we need to preserve that. It is questionable if we have to preserve the currently non-working property $orderedResults, but I think it is not needed (is it possible someone is using it despite that is always empty?).

  • mcdruid committed 240afdc on 7.x
    Issue #1292930 by disasm, bxtaylor, poker10, loganfsmyth, ACF:...
mcdruid’s picture

Status: Needs review » Fixed
Issue tags: -Needs change record

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.