You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How do you serve Shlink: Self-hosted, Apache 2.4.29, Ubuntu 18.04.4 LTS
Database engine used: MySQL 5.7.38
Summary
A 500 Internal Server Error occurs while filtering by tags with tagsMode=all and searchTerm at the same time.
Current behavior
It's throwing the following Doctrine ORM QueryException in logs:
Shlink.ERROR - Doctrine\ORM\Query\QueryException: SELECT DISTINCT s FROM Shlinkio\Shlink\Core\Entity\ShortUrl s LEFT JOIN s.domain d INNER JOIN s.tags t_0 WITH t_0.name = :tag0 INNER JOIN s.tags t_1 WITH t_1.name = :tag1 INNER JOIN s.tags t_2 WITH t_2.name = :tag2 INNER JOIN s.tags t_3 WITH t_3.name = :tag3 WHERE 1=1 AND s.dateCreated >= :startDate AND s.dateCreated <= :endDate AND (s.longUrl LIKE :searchPattern OR s.shortCode LIKE :searchPattern OR s.title LIKE :searchPattern OR t.name LIKE :searchPattern OR d.authority LIKE :searchPattern) ORDER BY s.dateCreated DESC in /var/www/gsl.cards/vendor/doctrine/orm/lib/Doctrine/ORM/Query/QueryException.php:21
Shlink has always taken into consideration tag names for the filtering when providing a search term (it basically tries to match in the long URL, short code, title, domain and tags fields, including the result if any of them matches).
However, in order to allow searching by a full list of tags, I had to change how the tags and short URLs tables are joined, by making short URLs table join with the tags table for every provided tag, and match every join by tag name.
This basically makes it impossible to search by tag name on the search term, when you are also filtering by "ALL" tags, unless the search term is also one of those tags, which is useless.
Because of that, I'm going to exlcude the tag name from the search term filtering when the tags mode is ALL, as it adds very little value and it seems to not be possible to achive anyway.
When the tags mode is ANY or no tags are provided, the search term will continue applying to the tags name.
How Shlink is set-up
Summary
A 500 Internal Server Error occurs while filtering by
tags
withtagsMode=all
andsearchTerm
at the same time.Current behavior
It's throwing the following Doctrine ORM
QueryException
in logs:Full Stack Trace: shlink-tags-error-053122.txt
Expected behavior
It should return properly filtered results.
How to reproduce
Example Request:
Response:
The text was updated successfully, but these errors were encountered: