diff --git a/src/Omatech/Editora/Extractor/Extractor.php b/src/Omatech/Editora/Extractor/Extractor.php index 36ae703..ef6229f 100644 --- a/src/Omatech/Editora/Extractor/Extractor.php +++ b/src/Omatech/Editora/Extractor/Extractor.php @@ -648,13 +648,13 @@ public function findInstancesByUrl(string $url, $params = null, callable $callba $inst_ids = $row['inst_id']; } - $sql = "select CONCAT(parents, ',', inst_id) as ids + $sql = "select IF(parents IS NULL, inst_id, CONCAT(parents, ',', inst_id)) as ids from omp_instances i , omp_niceurl u where 1=1 and i.id = u.inst_id and u.language = '" . $this->lang . "' - and u.full_niceurl = '" . $url . "' + and (u.full_niceurl = '" . $url . "' OR u.niceurl = '" . $url . "') "; $row = $this->fetchAssoc($sql); if (isset($row['ids'])) {