Coder Social home page Coder Social logo

astehlik / typo3-extension-tinyurls Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 9.0 1.01 MB

TYPO3 extension that allows you to cut down long URLs. It basically works like bitly or TinyURL.

Home Page: http://typo3.org/extensions/repository/view/tinyurls

PHP 98.77% HTML 0.33% JavaScript 0.70% Shell 0.19%

typo3-extension-tinyurls's Introduction

typo3-extension-tinyurls's People

Contributors

astehlik avatar mbrodala avatar peterkraume avatar mediaessenz avatar cavaquino avatar

Stargazers

Josef Glatz avatar Jonathan Heilmann avatar Adrian Föder avatar

Watchers

James Cloos avatar  avatar

typo3-extension-tinyurls's Issues

Faulty calculation of $base in protected function convertIntToBase62

Since there is no guarantee the the base62Dictionary has a length of 62 (if configured otherwise) that method should be changed from

  protected function convertIntToBase62(int $base10Integer, string $base62Dictionary): string
  {
      $base62Integer = '';
      $base = 62;

      do {
          $base62Integer = $base62Dictionary[$base10Integer % $base] . $base62Integer;
          $base10Integer = floor($base10Integer / $base);
      } while ($base10Integer > 0);

      return $base62Integer;
  }

to:

protected function convertIntToBase62(int $base10Integer, string $base62Dictionary): string
  {
      $base62Integer = '';
      // Use length of $base62Dictionary as base - stuff is a bit misleading if $base62Dictionary
      // doesn't contain 62 letters
      $base = strlen($base62Dictionary);

      do {
          $base62Integer = $base62Dictionary[($base10Integer % $base)] . $base62Integer;
          $base10Integer = floor($base10Integer / $base);
      } while ($base10Integer > 0);

      return $base62Integer;
  }

Or else the following error can be found in error logs
PHP Warning: Uninitialized string offset 61 in web/typo3conf/ext/tinyurls/Classes/UrlKeyGenerator/Base62UrlKeyGenerator.php line 98

TYPO3 10 compatibility

Hello

First of all, thanks for your extension. It helps sharing pages on twitter!

Do you plan to make it compatible with TYPO3 10?

Dependencies TYPO3 (6.2.3 - 8.99.99) for Version 2.0.0 Beta

Enabling : Create speaking URLs [basic.createSpeakingURLs]
crashes on TYPO3 CMS 6.2.x

Reason: makeInstance(MarkerBasedTemplateService::class) fails in 6.2.x

We have to either change dependency from 6.2.3 to 7.5
or change line 157 in typo3conf/ext/tinyurls/Classes/Utils/UrlUtils.php

from return GeneralUtility::makeInstance(MarkerBasedTemplateService::class);
to return GeneralUtility::makeInstance(HtmlParser::class);

Change viewhelper argument registration method

Support for arguments on the render() method of ViewHelpers has been deprecated.

https://docs.typo3.org/typo3cms/extensions/core/Changelog/9.0/Deprecation-81213-RenderMethodArgumentOnViewHelpersDeprecated.html

They should be registered with initializeArguments.

Also, the base class is deprecated, so the ViewHelper now needs to extend directly TYPO3Fluid base class, and to use renderStatic method.

https://docs.typo3.org/typo3cms/extensions/core/latest/Changelog/9.0/Breaking-82414-RemoveCMSBaseViewHelperClasses.html

Missing composer tag

The latest tag is 1.0.0 but the emconf has been bumped to 1.0.1.

Please tag with 1.0.1

Support for multiple domains

At the moment the URL shortener only supports one domain.

TODO: Check if support for multiple domains makes sense and how it can be implemented.

List module causes ArgumentCountError

When use the list module in TYPO3 10.4. using v10.0.0, you get the following error

Too few arguments to function Tx\Tinyurls\Hooks\DatabaseRecordList::__construct(), 0 passed in /web/typo3/sysext/core/Classes/Utility/GeneralUtility.php on line 3443 and exactly 1 expected

Now the rest of the extension works just fine.

listdisplay-error with urldisplay

When adding "urldisplay" with "set Field" in list-view-mode, the backend strumbles and there no way to deselect it.
I added a dummyfield to the database to fix that.

Please give ready2use url when creating new tinyurl

To use the tinyurl an editor has to copy the wished long url into the new tinyurl form.
On saving this long url he then can read the new tinyurl.
The ditor then has to remember the speakingurl he has to use and type this in where he wants to use it.

It would saving 90% of all this work if below the URL key in the BE form would appear the speakingurl
according to the active ###TYPO3_SITE_URL###goto/###TINY_URL_KEY### template.
So above the Target URL field there could be a field like this:
Use TinyURL (copy and paste)
http://mydomain.tld/goto/b-xyz4712

Please write timestamp

There is a field tstamp in the tx_tinyurls_urls table, which is always 0.
Please add timestamp in insert statement.

Allow "URL key" in BE form to copy

Without being able to copy the URL key from the BE form the extensions is completely useless.
Do you expect any editor to retype this key ten times a day?

Broken createSpeakingURLs functionality on the 1.0.1 tag on packagist

The createSpeakingURLs functionality of the 1.0.1 version that is on packagist.org doesn't work.

if ($this->configUtils->getExtensionConfigurationValue('createSpeakingURLs')) {
$tinyUrl = $this->urlUtils->generateTinyurlHash($tinyUrlKey);
} else {

Should probably have been
if ($this->configUtils->getExtensionConfigurationValue('createSpeakingURLs')) {
$tinyUrl = $this->urlUtils->createSpeakingTinyUrl($tinyUrlKey);
} else {

Could you make a 1.0.2 with a fix thanks.

[TASK] Fix TCA deprecations

For the Field valid_until the following two TCA deprecations exists:

The TCA setting 'renderType' => 'inputDateTime' was added in TCA tx_tinyurls_urls['columns']['valid_until']['config']
The config option 'max' has been removed from the TCA for renderType='inputDateTime' in tx_tinyurls_urls['columns']['valid_until']['config']['max']

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.