Commit 9faca437 authored by Andreas Nedbal's avatar Andreas Nedbal
Browse files

[BUGFIX] Fix deprecations

- 80929: TYPO3_DB usage
- 83167: Replacing validate annotation
- 83078: Replacing lazy annotation
- 82414: Removal of ViewHelper base classes
- 87277: Moving TYPO3/CMS/Fluid namespace to TYPO3Fluid/Fluid
- 85285: Deprecated path related constants
- 73516: Removal of some GeneralUtility functions
- 75621: Switching GeneralUtility with PHP core functions
parent a97ea8f4
......@@ -14,6 +14,7 @@ namespace T3o\Certifications\Domain\Model;
* The TYPO3 project - inspiring people to share!
*/
use DateTime;
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
class Certificate extends AbstractEntity
......@@ -22,15 +23,15 @@ class Certificate extends AbstractEntity
/**
* certificationDate
*
* @var \DateTime
* @validate NotEmpty
* @var DateTime
* @TYPO3\CMS\Extbase\Annotation\Validate NotEmpty
*/
protected $certificationDate;
/**
* expirationDate
*
* @var \DateTime
* @var DateTime
*/
protected $expirationDate;
......@@ -51,14 +52,14 @@ class Certificate extends AbstractEntity
/**
* certificateType
*
* @var \T3o\Certifications\Domain\Model\CertificateType
* @var CertificateType
*/
protected $certificateType;
/**
* Returns the certificationDate
*
* @return \DateTime $certificationDate
* @return DateTime $certificationDate
*/
public function getCertificationDate()
{
......@@ -68,7 +69,7 @@ class Certificate extends AbstractEntity
/**
* Sets the certificationDate
*
* @param \DateTime $certificationDate
* @param DateTime $certificationDate
* @return void
*/
public function setCertificationDate($certificationDate)
......@@ -79,7 +80,7 @@ class Certificate extends AbstractEntity
/**
* Returns the expirationDate
*
* @return \DateTime $expirationDate
* @return DateTime $expirationDate
*/
public function getExpirationDate()
{
......@@ -89,7 +90,7 @@ class Certificate extends AbstractEntity
/**
* Sets the expirationDate
*
* @param \DateTime $expirationDate
* @param DateTime $expirationDate
* @return void
*/
public function setExpirationDate($expirationDate)
......
......@@ -66,15 +66,15 @@ class User extends AbstractEntity
/**
* certificates
*
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\T3o\Certifications\Domain\Model\Certificate>
* @lazy
* @var ObjectStorage
* @TYPO3\CMS\Extbase\Annotation\ORM\Lazy
*/
protected $certificates;
/**
* feUser
*
* @var \TYPO3\CMS\Extbase\Domain\Model\FrontendUser
* @var FrontendUser
*/
protected $feUser;
......
......@@ -44,7 +44,8 @@ class UserRepository extends Repository
*/
public function findByFirstChar($char = 'A')
{
$char = $GLOBALS['TYPO3_DB']->escapeStrForLike($char, 'fe_users');
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('fe_users');
$char = $queryBuilder->escapeLikeWildcards($char);
$query = $this->createQuery();
$query->setOrderings(
[
......
......@@ -14,13 +14,14 @@ namespace T3o\Certifications\ViewHelpers;
* The TYPO3 project - inspiring people to share!
*/
use stdClass;
use TYPO3\CMS\Core\Utility\CommandUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper;
use TYPO3\CMS\Fluid\Core\ViewHelper\Exception;
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper;
use TYPO3Fluid\Fluid\Core\ViewHelper\Exception;
/**
* Resizes a given image (if required) and renders the respective img tag
......@@ -149,7 +150,7 @@ class GrayImageViewHelper extends AbstractTagBasedViewHelper
//Convert to grey
$newFile = substr($imageInfo[3], 0, -4) . '.jpg';
$cmd = GeneralUtility::imageMagickCommand('convert', '"' . $imageInfo[3] . '" -colorspace Gray "' . $newFile . '"', $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path_lzw']);
$cmd = CommandUtility::imageMagickCommand('convert', '"' . $imageInfo[3] . '" -colorspace Gray "' . $newFile . '"', $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path_lzw']);
CommandUtility::exec($cmd);
$imageInfo[3] = $newFile;
if (@is_file($newFile)) {
......@@ -158,7 +159,7 @@ class GrayImageViewHelper extends AbstractTagBasedViewHelper
$GLOBALS['TSFE']->imagesOnPage[] = $imageInfo[3];
$imageSource = $GLOBALS['TSFE']->absRefPrefix . GeneralUtility::rawUrlEncodeFP($imageInfo[3]);
$imageSource = $GLOBALS['TSFE']->absRefPrefix . rawUrlEncodeFP($imageInfo[3]);
if (TYPO3_MODE === 'BE') {
$imageSource = '../' . $imageSource;
$this->resetFrontendEnvironment();
......@@ -189,14 +190,14 @@ class GrayImageViewHelper extends AbstractTagBasedViewHelper
$this->tsfeBackup = isset($GLOBALS['TSFE']) ? $GLOBALS['TSFE'] : NULL;
// set the working directory to the site root
$this->workingDirectoryBackup = getcwd();
chdir(PATH_site);
chdir(Environment::getPublicPath() . '/');
$typoScriptSetup = $this->configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT);
$GLOBALS['TSFE'] = new \stdClass();
$GLOBALS['TSFE'] = new stdClass();
$template = GeneralUtility::makeInstance('t3lib_TStemplate');
$template->tt_track = 0;
$template->init();
$template->getFileName_backPath = PATH_site;
$template->getFileName_backPath = Environment::getPublicPath() . '/';
$GLOBALS['TSFE']->tmpl = $template;
$GLOBALS['TSFE']->tmpl->setup = $typoScriptSetup;
$GLOBALS['TSFE']->config = $typoScriptSetup;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment