Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 00f65ffd45 | |||
| 142cab2203 |
@@ -17,7 +17,7 @@ class OrganizationListingTemplateDataListener
|
|||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly Connection $connection,
|
private readonly Connection $connection,
|
||||||
private readonly LoggerInterface $logger,
|
private readonly ?LoggerInterface $logger = null,
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -146,7 +146,7 @@ class OrganizationListingTemplateDataListener
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($rowsWithoutTagSlugs > 0) {
|
if (null !== $this->logger && $rowsWithoutTagSlugs > 0) {
|
||||||
$this->logger->warning('Organization listing tag enrichment left rows without tag slugs.', [
|
$this->logger->warning('Organization listing tag enrichment left rows without tag slugs.', [
|
||||||
'template' => (string) $template->getName(),
|
'template' => (string) $template->getName(),
|
||||||
'totalRows' => \count($tbody),
|
'totalRows' => \count($tbody),
|
||||||
@@ -312,6 +312,22 @@ class OrganizationListingTemplateDataListener
|
|||||||
)->fetchAllAssociative();
|
)->fetchAllAssociative();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ([] === $rows) {
|
||||||
|
$rows = $this->connection->executeQuery(
|
||||||
|
'SELECT r.pid AS organization_id, r.tag_id, t.tag AS label FROM tl_tags_rel r INNER JOIN tl_tags t ON t.id = r.tag_id WHERE r.field = ? AND r.pid IN (?) ORDER BY r.pid ASC, r.tag_id ASC',
|
||||||
|
['tags', $organizationIds],
|
||||||
|
[ParameterType::STRING, ArrayParameterType::INTEGER],
|
||||||
|
)->fetchAllAssociative();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ([] === $rows) {
|
||||||
|
$rows = $this->connection->executeQuery(
|
||||||
|
'SELECT r.pid AS organization_id, r.tag_id, t.tag AS label FROM tl_tags_rel r INNER JOIN tl_tags t ON t.id = r.tag_id WHERE r.pid IN (?) ORDER BY r.pid ASC, r.tag_id ASC',
|
||||||
|
[$organizationIds],
|
||||||
|
[ArrayParameterType::INTEGER],
|
||||||
|
)->fetchAllAssociative();
|
||||||
|
}
|
||||||
|
|
||||||
$map = [];
|
$map = [];
|
||||||
$seen = [];
|
$seen = [];
|
||||||
|
|
||||||
@@ -361,6 +377,22 @@ class OrganizationListingTemplateDataListener
|
|||||||
[ParameterType::STRING, ArrayParameterType::STRING],
|
[ParameterType::STRING, ArrayParameterType::STRING],
|
||||||
)->fetchAllAssociative();
|
)->fetchAllAssociative();
|
||||||
|
|
||||||
|
if ([] === $rows) {
|
||||||
|
$rows = $this->connection->executeQuery(
|
||||||
|
'SELECT o.title, r.tag_id, t.tag AS label FROM tl_organization o INNER JOIN tl_tags_rel r ON r.pid = o.id AND r.field = ? INNER JOIN tl_tags t ON t.id = r.tag_id WHERE o.title IN (?) ORDER BY o.title ASC, r.tag_id ASC',
|
||||||
|
['tags', $titles],
|
||||||
|
[ParameterType::STRING, ArrayParameterType::STRING],
|
||||||
|
)->fetchAllAssociative();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ([] === $rows) {
|
||||||
|
$rows = $this->connection->executeQuery(
|
||||||
|
'SELECT o.title, r.tag_id, t.tag AS label FROM tl_organization o INNER JOIN tl_tags_rel r ON r.pid = o.id INNER JOIN tl_tags t ON t.id = r.tag_id WHERE o.title IN (?) ORDER BY o.title ASC, r.tag_id ASC',
|
||||||
|
[$titles],
|
||||||
|
[ArrayParameterType::STRING],
|
||||||
|
)->fetchAllAssociative();
|
||||||
|
}
|
||||||
|
|
||||||
$map = [];
|
$map = [];
|
||||||
$seen = [];
|
$seen = [];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user