PageList - filtering by custom attribute with comparison

Permalink
Hello, Everyone!

I have a custom page attribute (Multi-Page selector) that contains array of related pages IDs. How can I filter this attribute with the PageList object by "equal" comparison?

Methods, like this:

$pl->filterByAttribute('related_pages', $this->pID, "=") or
$pl->filterByAttribute('related_pages', "$this->pID", 'like');

give an Doctrine\ DBAL \ Exception \ InvalidFieldNameException - SQLSTATE[42S22]: Column not found: 1054 Unknown column 'ak_related_pages' in 'where clause'.

This attribute is included in the search index.

Thanks, Nick.

brutalnv
 
hutman replied on at Permalink Reply
hutman
This sounds like "related_pages" might not be the Handle that's defined for your Page Attribute.
brutalnv replied on at Permalink Reply
brutalnv
Unfortunately, no, the attribute handle is defined correctly. The wrong handle gives "Unable to find attribute" exception.
softwallcave replied on at Permalink Reply
Because it is an array. You likely will have to run the query and then filter against the extracted values from your multi-select. That is what I had to do for v5.6, though current versions may be different. Who know with the paucity of documentation though.