TickTackk
Well-known member
- Affected version
- 2.0.x
In extended entity:
under
Generated query will have something like this:
Fix (not 100% sure):
Find:
Replace with:
In file:
PHP:
$structure->relations['Report'] = [
'entity' => 'XF:Report',
'type' => self::TO_ONE,
'conditions' => [
['content_type', '=', '$content_type'],
['content_id', '=', '$content_id'],
['report_state', '=', ['open', 'assigned']]
],
'primary' => true
];
under
PHP:
public static function getStructure(Structure $structure)
Generated query will have something like this:
SQL:
ON (`xf_report_Report_1`.`content_type` = `xf_approval_queue`.`content_type` AND `xf_report_Report_1`.`content_id` = `xf_approval_queue`.`content_id` AND `xf_report_Report_1`.`report_state` = 'open', 'assigned')
Fix (not 100% sure):
Find:
PHP:
else if (is_string($value) && $value && $value[0] == '$')
{
$value = "`$joinTable`.`" . substr($value, 1) . '`';
}
else
{
$value = $this->db->quote($value);
}
Replace with:
PHP:
else if (is_string($value) && $value && $value[0] == '$')
{
$value = "`$joinTable`.`" . substr($value, 1) . '`';
}
else if (is_array($value))
{
$value = '(' . $this->db->quote($value) . ')';
$operator = 'IN';
}
else
{
$value = $this->db->quote($value);
}
In file:
src\XF\Mvc\Entity\Finder.php
Last edited: