Skip to content

Commit

Permalink
Merge branch 'staging'
Browse files Browse the repository at this point in the history
  • Loading branch information
NamelessCoder committed Jan 22, 2021
2 parents 5623478 + 1df2beb commit ba340bc
Show file tree
Hide file tree
Showing 10 changed files with 59 additions and 20 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Latest release: 6.0.4 (2020/09/22)
Latest release: 6.0.5 (2021/01/22)

All previous release change logs:

* [6.0.5 (2021/01/22)](Documentation/Changelog/6.0.5.md) [Full list of changes](https://github.com/FluidTYPO3/vhs/compare/6.0.4...6.0.5)
* [6.0.4 (2020/09/22)](Documentation/Changelog/6.0.4.md) [Full list of changes](https://github.com/FluidTYPO3/vhs/compare/6.0.3...6.0.4)
* [6.0.3 (2020/06/02)](Documentation/Changelog/6.0.3.md) [Full list of changes](https://github.com/FluidTYPO3/vhs/compare/6.0.2...6.0.3)
* [6.0.2 (2020/06/01)](Documentation/Changelog/6.0.2.md) [Full list of changes](https://github.com/FluidTYPO3/vhs/compare/6.0.1...6.0.2)
Expand Down
18 changes: 12 additions & 6 deletions Classes/Service/AssetService.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
use FluidTYPO3\Vhs\Asset;
use FluidTYPO3\Vhs\Utility\CoreUtility;
use FluidTYPO3\Vhs\ViewHelpers\Asset\AssetInterface;
use Psr\Log\LoggerInterface;
use TYPO3\CMS\Core\Log\LogManager;
use TYPO3\CMS\Core\SingletonInterface;
use TYPO3\CMS\Core\Utility\ArrayUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
Expand All @@ -30,7 +32,6 @@
*/
class AssetService implements SingletonInterface
{

/**
* @var string
*/
Expand Down Expand Up @@ -627,6 +628,10 @@ protected function copyReferencedFilesAndReplacePaths($contents, $regex, $origin
$replacements = [];
$wrap = explode('|', $wrap);
preg_match_all($regex, $contents, $matches);
$logger = null;
if (class_exists(LogManager::class)) {
$logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(__CLASS__);
}
foreach ($matches[2] as $matchCount => $match) {
$match = trim($match, '\'" ');
if (false === strpos($match, ':') && !preg_match('/url\\s*\\(/i', $match)) {
Expand All @@ -646,11 +651,12 @@ protected function copyReferencedFilesAndReplacePaths($contents, $regex, $origin
) . $path;
$realPath = realpath($rawPath);
if (false === $realPath) {
GeneralUtility::sysLog(
'Asset at path "' . $rawPath . '" not found. Processing skipped.',
'vhs',
GeneralUtility::SYSLOG_SEVERITY_WARNING
);
$message = 'Asset at path "' . $rawPath . '" not found. Processing skipped.';
if ($logger instanceof LoggerInterface) {
$logger->warning($message, ['rawPath' => $rawPath]);
} else {
GeneralUtility::sysLog($message, GeneralUtility::SYSLOG_SEVERITY_WARNING);
}
} else {
if (false === file_exists($temporaryFile)) {
copy($realPath, $temporaryFile);
Expand Down
3 changes: 1 addition & 2 deletions Classes/ViewHelpers/DebugViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
use TYPO3\CMS\Extbase\Utility\DebuggerUtility;
use TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ObjectAccessorNode as LegacyFluidObjectAccessorNode;
use TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode as LegacyFluidViewHelperNode;
use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\ChildNodeAccessInterface;
use TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\ObjectAccessorNode as StandaloneFluidObjectAccessorNode;
use TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\ViewHelperNode as StandaloneFluidViewHelperNode;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
Expand Down Expand Up @@ -65,7 +64,7 @@
* @package Vhs
* @subpackage ViewHelpers
*/
class DebugViewHelper extends AbstractViewHelper implements ChildNodeAccessInterface
class DebugViewHelper extends AbstractViewHelper
{

/**
Expand Down
8 changes: 7 additions & 1 deletion Classes/ViewHelpers/Iterator/ExtractViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
* LICENSE.md file that was distributed with this source code.
*/

use Psr\Log\LoggerInterface;
use TYPO3\CMS\Core\Log\LogManager;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Reflection\ObjectAccess;
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
Expand Down Expand Up @@ -125,7 +127,11 @@ public static function renderStatic(
$result = static::extractByKey($content, $key);
}
} catch (\Exception $error) {
GeneralUtility::sysLog($error->getMessage(), 'vhs', GeneralUtility::SYSLOG_SEVERITY_WARNING);
if (class_exists(LogManager::class)) {
GeneralUtility::makeInstance(LogManager::class)->getLogger(__CLASS__)->warning($error->getMessage(), ['content' => $content]);
} else {
GeneralUtility::sysLog($error->getMessage(), 'vhs', GeneralUtility::SYSLOG_SEVERITY_WARNING);
}
$result = [];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
*/

use FluidTYPO3\Vhs\Utility\ResourceUtility;
use TYPO3\CMS\Core\Resource\FileReference as CoreFileReference;
use TYPO3\CMS\Core\Resource\ResourceFactory;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Domain\Model\FileReference;
use TYPO3\CMS\Extbase\Domain\Model\FileReference as ExtbaseFileReference;
use TYPO3Fluid\Fluid\Core\ViewHelper\Exception;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;

Expand Down Expand Up @@ -86,7 +87,7 @@ public function getInfo()
}
}

if (is_object($src) && $src instanceof FileReference) {
if (is_object($src) && ($src instanceof CoreFileReference || $src instanceof ExtbaseFileReference)) {
$src = $src->getUid();
$treatIdAsUid = false;
$treatIdAsReference = true;
Expand Down
15 changes: 12 additions & 3 deletions Classes/ViewHelpers/Page/Header/MetaViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,25 @@ public function render()
$content = $this->arguments['content'];
if (!empty($content)) {
$pageRenderer = static::getPageRenderer();
if (method_exists($pageRenderer, 'addMetaTag')) {
if (!method_exists($pageRenderer, 'setMetaTag')) {
$pageRenderer->addMetaTag($this->renderTag($this->tagName, null, ['content' => $content]));
} else {
$properties = [];
foreach (['http-equiv', 'scheme', 'lang', 'dir'] as $propertyName) {
$type = 'name';
$name = $this->tag->getAttribute('name');
if (!empty($this->tag->getAttribute('property'))) {
$type = 'property';
$name = $this->tag->getAttribute('property');
} elseif (!empty($this->tag->getAttribute('http-equiv'))) {
$type = 'http-equiv';
$name = $this->tag->getAttribute('http-equiv');
}
foreach (['http-equiv', 'property', 'scheme', 'lang', 'dir'] as $propertyName) {
if (!empty($this->tag->getAttribute($propertyName))) {
$properties[$propertyName] = $this->tag->getAttribute($propertyName);
}
}
$pageRenderer->setMetaTag('name', $this->arguments['name'], $content, $properties);
$pageRenderer->setMetaTag($type, $name, $content, $properties);
}
}
}
Expand Down
4 changes: 1 addition & 3 deletions Classes/ViewHelpers/Security/DenyViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
* LICENSE.md file that was distributed with this source code.
*/

use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\ChildNodeAccessInterface;

/**
* ### Security: Deny
*
Expand All @@ -19,7 +17,7 @@
*
* Is the mirror opposite of `v:security.allow`.
*/
class DenyViewHelper extends AbstractSecurityViewHelper implements ChildNodeAccessInterface
class DenyViewHelper extends AbstractSecurityViewHelper
{

/**
Expand Down
19 changes: 19 additions & 0 deletions Documentation/Changelog/6.0.5.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## Release: 6.0.5 (2021/01/22)

* 2020-07-26 [BUGFIX] Replaced GeneralUtility::sysLog calls with calls to the logging API (Commit 3ec66b15 by bink)
* 2021-01-06 [BUGFIX] Drop ChildNodeAccessInterface usage (Commit 4eeaccbf by Mathias Brodala)
* 2020-12-08 [BUGFIX] Correctly use PageRender meta tag API (Commit 885f5465 by Claus Due)
* 2020-10-20 [BUGFIX] Support core FileReference in image size viewhelpers (Commit 53afafdd by Mathias Brodala)

Generated by:

```
git log --since="2020/09/22" --until="2021/01/22" --abbrev-commit --pretty='%ad %s (Commit %h by %an)' \
--date=short | egrep '(\[FEATURE|BUGFIX|REMOVAL\])+'`
```

Full list of changes: https://github.com/FluidTYPO3/vhs/compare/6.0.4...6.0.5

*Please note: the change list above does not contain any TASK commits since they are considered
infrastructure-only and not relevant to end users. The full list includes these!*

2 changes: 1 addition & 1 deletion Documentation/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VHS: Documentation
======================

Please visit our full documentation at: https://fluidtypo3.org/viewhelpers/vhs/master.html.
Please visit our full documentation at: https://viewhelpers.fluidtypo3.org/fluidtypo3/vhs/.
You can also browse through the markdown files here, but other website has a much nicer view ;-).
2 changes: 1 addition & 1 deletion ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
'conflicts' => '',
'priority' => '',
'module' => '',
'state' => 'stable',
'state' => 'beta',
'internal' => '',
'uploadfolder' => 0,
'createDirs' => '',
Expand Down

0 comments on commit ba340bc

Please sign in to comment.