This issue is because the view condition doesn't respect the alias of the table. Attaching patch in the follow up comment.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

agupta’s picture

Status: Active » Needs review
FileSize
528 bytes
ac’s picture

Status: Needs review » Reviewed & tested by the community

This fixes the issue - can this be committed?

Status: Reviewed & tested by the community » Needs work

The last submitted patch, feeds-views-alias-1829212.patch, failed testing.

alan-ps’s picture

Version: 7.x-2.0-alpha7 » 7.x-2.x-dev
Issue summary: View changes
Status: Needs work » Needs review
FileSize
431 bytes

I encountered with same problem. We can also remove operator element (by default =). Correct patch was attached.

MegaChriz’s picture

I'd like to test the patch. When does this problem occur?

alan-ps’s picture

FileSize
71.68 KB

This is occur when you are using relationship for the Feeds item. I've attached an image for check.

MegaChriz’s picture

Status: Needs review » Reviewed & tested by the community

@alan-io1 Thanks for posting the image! That was very helpful.

I tested the patch. The issue seems to only arise when the feeds_item table is joined twice, for example when you want to show guids or import dates of both nodes and the attached taxonomy terms. Or, when using Commerce, guids/import dates from both the product displays as well as the products.
However, I didn't get the error message from the original poster (maybe due to changes in the Views module?).

I looked up in the Views documentation what that "extra" actually means (so I can verify if the patch in #4 fixes the issue in the right way). This from the Views advanced help:

extra
Either a string that's directly added, or an array of items. Each item is, itself, an array:
table
table should not be set in most cases, as it would be filled with the right table alias. Set it to NULL if you want to use a formular in "field"
field
Field or formula, therein "%alias" can be used to reference the right table.
operator
Similar to filters, this is the operator, such as >, <, =, etc. Defaults to = or IN.
value
Must be set. If an array, operator will be defaulted to IN.
numeric
If true, the value will not be surrounded in quotes, and %d will be used for its placeholder.

I also tested if "extra" could be omitted completely, but that resulted into duplicate rows in my case, so the patch does the right thing.

RTBC.

  • twistor committed 6989426 on 7.x-2.x authored by alan-io1
    Issue #1829212 by alan-io1, agupta, MegaChriz, ac: SQLSTATE[42S22]:...
twistor’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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