mirror of
https://github.com/shlinkio/shlink.git
synced 2024-12-23 15:40:33 -06:00
Fixed edit short code action not being properly registered
This commit is contained in:
parent
ecebdbbfa8
commit
ce9d6642d4
@ -7,7 +7,6 @@ use Cocur\Slugify\Slugify;
|
|||||||
use Cocur\Slugify\SlugifyInterface;
|
use Cocur\Slugify\SlugifyInterface;
|
||||||
use Doctrine\Common\Cache\Cache;
|
use Doctrine\Common\Cache\Cache;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\ORM\ORMException;
|
|
||||||
use GuzzleHttp\ClientInterface;
|
use GuzzleHttp\ClientInterface;
|
||||||
use GuzzleHttp\Exception\GuzzleException;
|
use GuzzleHttp\Exception\GuzzleException;
|
||||||
use Psr\Http\Message\UriInterface;
|
use Psr\Http\Message\UriInterface;
|
||||||
@ -119,14 +118,14 @@ class UrlShortener implements UrlShortenerInterface
|
|||||||
$this->em->flush();
|
$this->em->flush();
|
||||||
|
|
||||||
// Generate the short code and persist it
|
// Generate the short code and persist it
|
||||||
$shortCode = $customSlug ?? $this->convertAutoincrementIdToShortCode($shortUrl->getId());
|
$shortCode = $customSlug ?? $this->convertAutoincrementIdToShortCode((float) $shortUrl->getId());
|
||||||
$shortUrl->setShortCode($shortCode)
|
$shortUrl->setShortCode($shortCode)
|
||||||
->setTags($this->tagNamesToEntities($this->em, $tags));
|
->setTags($this->tagNamesToEntities($this->em, $tags));
|
||||||
$this->em->flush();
|
$this->em->flush();
|
||||||
|
|
||||||
$this->em->commit();
|
$this->em->commit();
|
||||||
return $shortCode;
|
return $shortCode;
|
||||||
} catch (ORMException $e) {
|
} catch (\Throwable $e) {
|
||||||
if ($this->em->getConnection()->isTransactionActive()) {
|
if ($this->em->getConnection()->isTransactionActive()) {
|
||||||
$this->em->rollback();
|
$this->em->rollback();
|
||||||
$this->em->close();
|
$this->em->close();
|
||||||
|
@ -21,6 +21,7 @@ return [
|
|||||||
|
|
||||||
Action\AuthenticateAction::class => ConfigAbstractFactory::class,
|
Action\AuthenticateAction::class => ConfigAbstractFactory::class,
|
||||||
Action\CreateShortcodeAction::class => ConfigAbstractFactory::class,
|
Action\CreateShortcodeAction::class => ConfigAbstractFactory::class,
|
||||||
|
Action\EditShortCodeAction::class => ConfigAbstractFactory::class,
|
||||||
Action\ResolveUrlAction::class => ConfigAbstractFactory::class,
|
Action\ResolveUrlAction::class => ConfigAbstractFactory::class,
|
||||||
Action\GetVisitsAction::class => ConfigAbstractFactory::class,
|
Action\GetVisitsAction::class => ConfigAbstractFactory::class,
|
||||||
Action\ListShortcodesAction::class => ConfigAbstractFactory::class,
|
Action\ListShortcodesAction::class => ConfigAbstractFactory::class,
|
||||||
@ -48,6 +49,7 @@ return [
|
|||||||
'config.url_shortener.domain',
|
'config.url_shortener.domain',
|
||||||
'Logger_Shlink',
|
'Logger_Shlink',
|
||||||
],
|
],
|
||||||
|
Action\EditShortCodeAction::class => [Service\ShortUrlService::class, 'translator', 'Logger_Shlink',],
|
||||||
Action\ResolveUrlAction::class => [Service\UrlShortener::class, 'translator'],
|
Action\ResolveUrlAction::class => [Service\UrlShortener::class, 'translator'],
|
||||||
Action\GetVisitsAction::class => [Service\VisitsTracker::class, 'translator', 'Logger_Shlink'],
|
Action\GetVisitsAction::class => [Service\VisitsTracker::class, 'translator', 'Logger_Shlink'],
|
||||||
Action\ListShortcodesAction::class => [Service\ShortUrlService::class, 'translator', 'Logger_Shlink'],
|
Action\ListShortcodesAction::class => [Service\ShortUrlService::class, 'translator', 'Logger_Shlink'],
|
||||||
|
Loading…
Reference in New Issue
Block a user