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