Skip to content

Variable modifiers don't work in search results #458

@PaulBaileyAtChan

Description

@PaulBaileyAtChan

Description of the problem
(I'm posting this as a bug, because I'm not sure whether variable modifiers are currently expected to work in search result tags. If they're not expected to work, please read as a feature request!)

Variable modifiers appear not to currently work with search result tags. When a variable modifier is used with a tag, the tag is not parsed.

How To Reproduce
For example, using the :limit variable modifier to shorten the search excerpt just results in an unparsed tag:

{exp:search:search_results}
   {excerpt:limit characters='50'}
{/exp:search:search_results}

Another example (and the actual use-case which hit this error) is using :replace to modify the search result URL (in this case to remove the protocol, in order to provide a cleaner visual):

{if page_url}
   {page_url:replace find='/^http(s?):\/\//i' replace='' regex='yes'}
{if:else}
   {auto_path:replace find='/^http(s?):\/\//i' replace='' regex='yes'}
{/if}

In this case, the {page_url} tag is parsed correctly, and the :replace variable modifier works as expected (presumably because this tag is parsed by the Pages module itself, and not by the search module?). But the {auto_path} tag is unparsed. Without the variable modifier, the {auto_path} tag itself is fine.

Environment Details:

  • Version: 5.3.2
  • PHP Version: 7.0.33
  • OS: ubuntu 16.04.15
  • Web Server: Apache 2

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions