diff --git a/composer.json b/composer.json index 21c178cb..26e61e06 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "doctrine/cache": "^1.9", "doctrine/dbal": "^2.10", "doctrine/migrations": "^3.0.1", - "doctrine/orm": "^2.7", + "doctrine/orm": "^2.8", "endroid/qr-code": "^3.6", "geoip2/geoip2": "^2.9", "guzzlehttp/guzzle": "^7.0", @@ -50,7 +50,7 @@ "shlinkio/shlink-common": "^3.3.2", "shlinkio/shlink-config": "^1.0", "shlinkio/shlink-event-dispatcher": "^1.6", - "shlinkio/shlink-importer": "^2.0.1", + "shlinkio/shlink-importer": "^2.1", "shlinkio/shlink-installer": "^5.2.0", "shlinkio/shlink-ip-geolocation": "^1.5", "symfony/console": "^5.1", diff --git a/module/Core/src/Repository/ShortUrlRepository.php b/module/Core/src/Repository/ShortUrlRepository.php index 95e50f40..fc6ace41 100644 --- a/module/Core/src/Repository/ShortUrlRepository.php +++ b/module/Core/src/Repository/ShortUrlRepository.php @@ -7,6 +7,7 @@ namespace Shlinkio\Shlink\Core\Repository; use Doctrine\ORM\EntityRepository; use Doctrine\ORM\Query\Expr\Join; use Doctrine\ORM\QueryBuilder; +use Shlinkio\Shlink\Common\Doctrine\Type\ChronosDateTimeType; use Shlinkio\Shlink\Common\Util\DateRange; use Shlinkio\Shlink\Core\Entity\ShortUrl; use Shlinkio\Shlink\Core\Model\ShortUrlMeta; @@ -93,11 +94,11 @@ class ShortUrlRepository extends EntityRepository implements ShortUrlRepositoryI if ($dateRange !== null && $dateRange->getStartDate() !== null) { $qb->andWhere($qb->expr()->gte('s.dateCreated', ':startDate')); - $qb->setParameter('startDate', $dateRange->getStartDate()); + $qb->setParameter('startDate', $dateRange->getStartDate(), ChronosDateTimeType::CHRONOS_DATETIME); } if ($dateRange !== null && $dateRange->getEndDate() !== null) { $qb->andWhere($qb->expr()->lte('s.dateCreated', ':endDate')); - $qb->setParameter('endDate', $dateRange->getEndDate()); + $qb->setParameter('endDate', $dateRange->getEndDate(), ChronosDateTimeType::CHRONOS_DATETIME); } // Apply search term to every searchable field if not empty @@ -210,11 +211,11 @@ class ShortUrlRepository extends EntityRepository implements ShortUrlRepositoryI } if ($meta->hasValidSince()) { $qb->andWhere($qb->expr()->eq('s.validSince', ':validSince')) - ->setParameter('validSince', $meta->getValidSince()); + ->setParameter('validSince', $meta->getValidSince(), ChronosDateTimeType::CHRONOS_DATETIME); } if ($meta->hasValidUntil()) { $qb->andWhere($qb->expr()->eq('s.validUntil', ':validUntil')) - ->setParameter('validUntil', $meta->getValidUntil()); + ->setParameter('validUntil', $meta->getValidUntil(), ChronosDateTimeType::CHRONOS_DATETIME); } if ($meta->hasDomain()) { $qb->join('s.domain', 'd')