mt:regex() doesn't like alternation in report gen, but works in table query

Error message

Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'comment_node_forum_form' not found or invalid function name in drupal_retrieve_form() (line 844 of /var/www/www.gremwell.com/includes/form.inc).

I lifted the following query from the included summary-of-findings-details.docx report template:

{{mt:unique(//finding/source-severity[text()='high' and @status!='ignore']/../@title)}}{{../@id|bookmark,leaf}}

In the Table View expression, this works in order to isolate high vulns that apply to mysql. This expression also works in a report template.

mt:unique(//finding/source-severity[text()='high' and @status!='ignore' and ../id[mt:regex('mysql')]]/../@title)

However, I would also like to add oracle to the regex match. I do this by using the alternation pipe |

The following works in the Table View.

mt:unique(//finding/source-severity[text()='high' and @status!='ignore' and ../id[mt:regex('mysql|oracle')]]/../@title)

But when I try using this in the report template, it fails and I get an error saying Unexpected at the position where the | occurs.

Wondering if this is a bug (perhaps with my regex) or a limitation of the reporting regex?

We will investigate the problem. In the mean time, you can use the following expression as a workaround, it relies on native xpath functions instead of MT-specific extensions:

//id[contains(text(), 'mysql') or contains(text(), 'oracle')]

I have created issue #250 for this problem in FogBugz.

Alla

Add new comment

CAPTCHA
Please answer the question to prove that you are not a spammer. If it isn't working and you are not a spammer, please email us.
Fill in the blank.