Search

I’m using Symphony 2.0.8RC3, and the other day I came across what might be a bug in the data source filtering syntax. I have no idea if it has been reported previously.

I have data source that outputs a parameter consisting of system ids of members of a mediathek field. The resulting parameter looks like this on my ?debug=params page:

$ds-folio-art ‘91, 90, 96, 130, 92, 95, 108, 110, 126, 128, 137, 139, 141, 143, 145, 147, 149, 151, 153, 157, 155, 159, 161, 163, 165, 167, 169, 171, 173, 175, 177, 179, 181, 183, 185, 187, 189, 191, 193, 195, 241’

I use that in another data source to filter the section organized by the mediathek field. Originally this was how I did it:

Filter Results

Filter Art by: System ID

Value: {$ds-folio-art}

But the resulting xml only contained one match, and it was the first system id ‘91.’ When I copied and pasted the parameter value into the field, all the results were included in the xml as I expected. So I tried it like this:

Filter Results

Filter Art by: System ID

Value: {$ds-folio-art+}

and all of the ids had matching entries in the xml. I did it this way hoping to trick the parser into evaluating the entire set of ids because it seemed to only want to see the first one. This isn’t how it’s supposed to work, is it?

Btw, I haven’t tried this in any version below 2.0.8RC3.

Thanks.

Have you set the limit to 1, by any chance? (This happened to me 5 mins ago, couldn’t figure out why the filter wasn’t working..)

I didn’t set the limit to 1, but I did have it set to 24. The problem I was trying to solve was how to paginate a mediathek field. Originally the data source that now returns the mediathek ids had been returning paginated items directly from the mediathek-organized section, and I didn’t bother to change the limit or the pagination settings since the 1 returned mediathek entry would definitely fall in that range.

Then the only problem I can see is that you might be filtering on the wrong field. Are the id’s you are filtering on the system id’s of the current section, or are they linked using a select box link?

Try using the same filter settings on the select box, and see if that works.

I am using ids from items in the current section provided by a mediathek field to filter the ids of the current section.

I have a section called Folios that is used to categorize another section called Art. Originally I had a field (select box link) in the Art section called ‘Folio’ to hold the category, but this became really tedious for managing categories, ordering, and previewing when there were numerous Art entries. So I’m trying out a mediathek field in the Folio section to maintain references to child Art entries. So far it seems to be working pretty well.

When pulling up art to show on a page, I use a url parameter to filter the Folios section to a single result, and that data source outputs a parameter holding the Folio’s mediathek field (Art) value. That value is a comma&space-delimited list of system ids from its associated Art items. I then use that parameter to filter the Art section system id field.

This works perfectly well if the filter on the Art system id field contains a literal comma&space-delimited list. But if I use the parameter name, it only matches the first id to an Art item. The remaining ids are ignored.

Here are more details:

DS Name: Folio-Art

Source: Folios

Filter Folios by:

System Name (Unique Text Input)

Value: {$folio:$ds-artfolio-settings} (the $ds-artfolio-settings is an output parameter for a default Folio if none is specified in the url)

Parameter Output: Use Field: Art (the mediathek field)

Included Elements: None (doesn’t make any difference for the mediathek parameter output)

=>

This is what appears in Debug (?debug=params)

$ds-folio-art ‘91, 90, 96, 130, 92, 95, 108, 110, 126, 128, 137, 139, 141, 143, 145, 147, 149, 151, 153, 157, 155, 159, 161, 163, 165, 167, 169, 171, 173, 175, 177, 179, 181, 183, 185, 187, 189, 191, 193, 195, 241’

=>

DS Name: Art

Source: Art

Filter Art by:

System ID

Value: {$ds-folio-art+}

Show a maximum of 24 results

Show page {$page:1} of results

=>

All 41 Art items appear in the xml. Pagination works correctly.

But if Value: {$ds-folio-art} is used in the filter, then only one Art item matching with id ‘91’ appears in the xml.

Arghhh. There was some stupidity on my part.

It turns out that {$ds-folio-art+} was only working because it was failing. ALL of the Art items were being returned because none were filtered. I had previously selected all the Art items for the mediathek to test the layout in the case of a large result set, so the ids did match the items in the generated xml.

But I still only get one result from {$ds-folio-art}. How should I go about getting it to properly filter a comma delimited set of ids in an output parameter?

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details