featdd / dpn_glossary

Glossary extension for TYPO3
http://typo3.org/extensions/repository/view/dpn_glossary
GNU General Public License v2.0
20 stars 29 forks source link

BUG: "Glossary preview list" #163

Closed cfindeisen closed 3 years ago

cfindeisen commented 3 years ago

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:

    public function findNewest(int $limit = self::DEFAULT_LIMIT): QueryResultInterface
    {
        return $this->createQuery()
            ->setOrderings([
                'crdate' => QueryInterface::ORDER_ASCENDING,
            ])
            ->setLimit($limit)
            ->execute();
    }

order_ascending



→ new function findNewest:

    public function findNewest(int $limit = self::DEFAULT_LIMIT): QueryResultInterface
    {
        return $this->createQuery()
            ->setOrderings([
                'crdate' => QueryInterface::ORDER_DESCENDING,
            ])
            ->setLimit($limit)
            ->execute();
    }

order_descending

featdd commented 3 years ago

Hi @cfindeisen,

thanks for your issue. There was no special reason, just a stupid mistake that I never noticed.

Solved in: 5727047fe7c7e02d9424eaceba9ea66478dff69a

Greetings Daniel