Skip to content

Instantly share code, notes, and snippets.

@Natetronn
Forked from croxton/gist:1084483
Created May 31, 2013 20:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Natetronn/5687674 to your computer and use it in GitHub Desktop.
Save Natetronn/5687674 to your computer and use it in GitHub Desktop.
<?php
// Look for this in mod.channel.php (around line 2635):
case 'custom_field' :
if (strpos($corder[$key], '|') !== FALSE)
{
$end .= "CONCAT(wd.field_id_".implode(", wd.field_id_", explode('|', $corder[$key])).")";
}
else
{
$end .= "wd.field_id_".$corder[$key];
}
break;
// And change to:
/* change start ---> */
case 'custom_field' :
if (strpos($corder[$key], '|') !== FALSE)
{
$end .= "CONCAT(wd.field_id_".implode(", wd.field_id_", explode('|', $corder[$key])).")";
}
else
{
$is_playa = FALSE;
$site_id = $this->EE->config->item('site_id');
if ( isset ($this->pfields[$site_id][$corder[$key]]))
{
if ( $this->pfields[$site_id][$corder[$key]] == 'playa')
{
$is_playa = TRUE;
}
}
// do we have a playa field
if ( $is_playa )
{
$end .= "SUBSTRING(wd.field_id_".$corder[$key].", (LOCATE(']', wd.field_id_".$corder[$key].")+1))";
}
else
{
$end .= "wd.field_id_".$corder[$key];
}
}
break;
/* <--- change end */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment