What version are you using? We fixed this problem in 2.9.3, though you can apply the solution if you'd rather not update.
Open system/expressionengine/libraries/channel_entries_parser/Preparser.php
and find the _find_modified_conditionals()
method around line 374, and replace it with this:
public function _find_modified_conditionals()
{
$prefix = $this->_prefix;
$unfiltered_all_field_names = array();
$all_field_names = array();
if (strpos($this->_tagdata, LD.'if') === FALSE)
{
return array();
}
foreach($this->_channel->cfields as $site_id => $fields)
{
$unfiltered_all_field_names = array_unique(array_merge($unfiltered_all_field_names, $fields));
}
// Do a rough cut to slim down the number of fields
// else the string can be too long for the preg_match_all
foreach (array_keys($unfiltered_all_field_names) as $name)
{
if (strpos($this->_tagdata, $name) !== FALSE)
{
$all_field_names[] = $name;
}
}
$modified_field_options = $prefix.implode('|'.$prefix, $all_field_names);
$modified_conditionals = array();
if (preg_match_all("/".preg_quote(LD)."((if:(else))*if)\s+(($modified_field_options):(\w+))(.*?)".preg_quote(RD)."/s", $this->_tagdata, $matches))
{
foreach($matches[5] as $match_key => $field_name)
{
$modified_conditionals[$field_name][] = $matches[6][$match_key];
}
}
return array_map('array_unique', $modified_conditionals);
}