I found a bug in the content element -> Glossary Preview List. There are 3 options to choose from in the CE: "Newest", "Random" and "Selected". My problem revolves around "Newest" and I have inserted the CE in my footer to show me the newest terms. But instead of the newest (last) terms, unfortunately only the oldest (first) terms come up. My guess is that it is because of the function "findNewest" in TermRepository.php.
Because of ORDER_ASCENDING it shows me the oldest created terms but with ORDER_DESCENDING it shows me the newest created terms. Here is a short summary to ORDER_ASCENDING/ ORDER_DESCENDING
Why did you add ascending order to the array instead of descending order?
Is ORDER_ASCENDING right for the function?
→ old function findNewest:
public function findNewest(int $limit = self::DEFAULT_LIMIT): QueryResultInterface
{
return $this->createQuery()
->setOrderings([
'crdate' => QueryInterface::ORDER_ASCENDING,
])
->setLimit($limit)
->execute();
}
→ new function findNewest:
public function findNewest(int $limit = self::DEFAULT_LIMIT): QueryResultInterface
{
return $this->createQuery()
->setOrderings([
'crdate' => QueryInterface::ORDER_DESCENDING,
])
->setLimit($limit)
->execute();
}
Hello there,
I found a bug in the content element -> Glossary Preview List. There are 3 options to choose from in the CE: "Newest", "Random" and "Selected". My problem revolves around "Newest" and I have inserted the CE in my footer to show me the newest terms. But instead of the newest (last) terms, unfortunately only the oldest (first) terms come up. My guess is that it is because of the function "findNewest" in TermRepository.php.
Because of ORDER_ASCENDING it shows me the oldest created terms but with ORDER_DESCENDING it shows me the newest created terms. Here is a short summary to ORDER_ASCENDING/ ORDER_DESCENDING
Why did you add ascending order to the array instead of descending order? Is ORDER_ASCENDING right for the function?
→ old function findNewest:
→ new function findNewest: