Search

I am running into a strange issue.

I have a set of entries (Links) grouped by Category. One of my Categories is called "Media & Downloads" – notice the ampersand…

In the result XML the @handle of the Category grouping is "media-and-amp-downloads" : <category handle="media-and-amp-downloads" value="Media &amp; Downloads">…</category>

I use another DS to fetch all Categories and the result of the @handle of the Category title is constructed differently: <title handle="media-and-downloads">Media &amp; Downloads</title>

This last @handle value seems correct. It looks like the handle of the grouping category is double converted(?)

This is a problem because I cannot use the two XML nodesets to filter: select="/data/links-in-footer/category[@handle = current()/title/@handle]/entry"

E.g. the current() handle of the "Media & Downloads" Category does not match the same category in a different node-set…

Sounds like a bug to me. The @handle and @value attribute values of the field you are grouping by are generated by the groupRecords method of that field type. So for example a Text Input field:

https://github.com/symphonycms/symphony-2/blob/master/symphony/lib/toolkit/fields/field.input.php#L295

It looks like the Lang::createHandle() method is being performed after the General::sanitize value. The latter converts & to &amp;, so this will be handleised to amp. I think line 304 should become:

$handle = Lang::createHandle($data['value']);

Unless there is a good reason why the handle function is called on the sanitised (XML-safe) string and not the original raw string? When a text input is saved the raw value is handleised and not the sanitised value.

that's what I thought (the sanitized value being converted: & becomes &amp; becomes and amp).

Should I report a bug?

I'll leave the best way to fix this to people knowing their way around Symphony code ;)

Yes, please do report a bug linking to this thread. Should be enough to issue a fix.

I've just ran into this issue with 2.2.5

Having a look on Git Hub I see the bug was Closed by this commit, however 2.2.5 still has the the original bug.

I'm not too familiar with git workflows but just incase anyone gets this same problem just copy the fix from that commit and I'm guessing it'll end up in the master branch soon. Do apologies if I've got this completely mixed up I have upgraded rather than clean install so its a possibility.

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