Skip to content
This repository has been archived by the owner on Dec 4, 2018. It is now read-only.

Commit

Permalink
Merge branch 'staging'
Browse files Browse the repository at this point in the history
  • Loading branch information
NamelessCoder committed Oct 23, 2015
2 parents fe05308 + 1da31c9 commit fd119d7
Show file tree
Hide file tree
Showing 13 changed files with 318 additions and 110 deletions.
25 changes: 24 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,31 @@
# Fluidcontent Change log

4.3.3 - 2015-10-24
------------------

- [TYPO3 7.5 is now officially supported](https://github.com/FluidTYPO3/fluidcontent/commit/99a3381a81dc89ff0b570a3f7b837157827ff1b1)
- [#290](https://github.com/FluidTYPO3/fluidcontent/pull/290) Bugfix for order of realpath/file_exists when processing icon file
- [#278](https://github.com/FluidTYPO3/fluidcontent/pull/278) In case no *Fluid Content type* is selected for content with CType `fluidcontent_content` an error message is shown in FE and BE
- Template `Content/Error.html` is used for error message
- Additionally rendering of preview is suppressed, when *Fluid Content type* is selected, but CType is not `fluidcontent_content`
- Such situation may happen, when changing content type from *Fluid Content* to something different

- [#284](https://github.com/FluidTYPO3/fluidcontent/pull/284) Disabled *Fluid Content type* drop-down for all CTypes, except `fluidcontent_content`

4.3.2 - 2015-09-10
------------------

- Avoid `realpath()` on icons when Flux version is older, causing bad icon references
- [Source commit with more info](https://github.com/FluidTYPO3/fluidcontent/commit/76a98ff5907c97bfac71e93d2dc7884807503258)

- Avoid `E_NOTICE` on missing array index
- [Source commit with more info](https://github.com/FluidTYPO3/fluidcontent/commit/6436d1c6d70d32483df92cf6606c23823dda898a)

- [#263](https://github.com/FluidTYPO3/fluidcontent/pull/263) Default SVG icon for CE is shown in case no icon provided

- [#273](https://github.com/FluidTYPO3/fluidcontent/pull/273) Icon size definitions in EM can now be strings
- Allows TYPO3 fancy definitions, like `24m` or `24c`

- Do not load BE-related cache in FE context
- [Source commit with more info](https://github.com/FluidTYPO3/fluidcontent/commit/f87ce58b7edbc4a4af8a2074aa9cc985d9e312d1)

Expand All @@ -18,19 +34,26 @@

- CE icon width and height can be defined in EM
- [Source commit with more info](https://github.com/FluidTYPO3/fluidcontent/commit/4bc2f324ed6b6dda490cee9b5915397861589168)

- [#262](https://github.com/FluidTYPO3/fluidcontent/pull/262) Bugfix when running with Flux 7.2

- Support for coming Flux 7.3 (metadata only)

4.3.0 - 2015-08-08
------------------

- Support for TYPO3 7.4

- :exclamation: No more testing for PHP 5.4
- Fluidcontent still supports TYPO3 6.2, which can be run on PHP 5.4, but it is adviced to upgrade your PHP to 5.5 (which is also supported by 6.2) at least
- Fluidcontent still supports TYPO3 6.2, which can be run on PHP 5.4, but it is advised to upgrade your PHP to 5.5 (which is also supported by 6.2) at least

- :exclamation: Default template `Index.html` removed
- [Source commit with more info](https://github.com/FluidTYPO3/fluidcontent/commit/c05dbd237dedbf84c69583626ef7096caf9dcb99)

- [#258](https://github.com/FluidTYPO3/fluidcontent/issues/258) `{settings}` are enriched with content settings, when *EXT:fluidcontent_core* is used

- [#227](https://github.com/FluidTYPO3/fluidcontent/issues/227) [#248](https://github.com/FluidTYPO3/fluidcontent/issues/248) Fixed broken inclusion of template files from subfolders

- [#253](https://github.com/FluidTYPO3/fluidcontent/issues/253) Fixed missing icons in "new CE" Wizard

4.2.4 - 2015-07-01
Expand Down
13 changes: 10 additions & 3 deletions Classes/Backend/TableConfigurationPostProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* LICENSE.md file that was distributed with this source code.
*/

use FluidTYPO3\Fluidcontent\Service\ConfigurationService;
use TYPO3\CMS\Core\Database\TableConfigurationPostProcessingHookInterface;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
Expand All @@ -23,11 +24,17 @@ class TableConfigurationPostProcessor implements TableConfigurationPostProcessin
* @return void
*/
public function processData() {
/** @var \FluidTYPO3\Fluidcontent\Service\ConfigurationService $configurationService */
ExtensionManagementUtility::addPageTSConfig($this->getConfigurationService()->getPageTsConfig());
}

/**
* @return ConfigurationService
*/
protected function getConfigurationService() {
/** @var ConfigurationService $configurationService */
$configurationService = GeneralUtility::makeInstance('TYPO3\CMS\Extbase\Object\ObjectManager')
->get('FluidTYPO3\Fluidcontent\Service\ConfigurationService');

ExtensionManagementUtility::addPageTSConfig($configurationService->getPageTsConfig());
return $configurationService;
}

}
10 changes: 5 additions & 5 deletions Classes/Controller/AbstractContentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ abstract class AbstractContentController extends AbstractFluxController implemen
/**
* @var ConfigurationService
*/
protected $configurationService;
protected $contentConfigurationService;

/**
* @param ConfigurationService $configurationService
* @return void
*/
public function injectConfigurationService(ConfigurationService $configurationService) {
$this->configurationService = $configurationService;
public function injectContentConfigurationService(ConfigurationService $configurationService) {
$this->contentConfigurationService = $configurationService;
}

/**
Expand All @@ -53,11 +53,11 @@ public function initializeView(ViewInterface $view) {
protected function initializeViewVariables() {
$row = $this->getRecord();
$form = $this->provider->getForm($row);
$generalSettings = $this->configurationService->convertFlexFormContentToArray($row['pi_flexform'], $form);
$generalSettings = $this->contentConfigurationService->convertFlexFormContentToArray($row['pi_flexform'], $form);
$this->settings = RecursiveArrayUtility::merge($this->settings, $generalSettings, FALSE, FALSE);
// Add fluidcontent_core form settings (to avoid flux:form.data in templates)
if (FALSE === empty($row['content_options'])) {
$contentSettings = $this->configurationService->convertFlexFormContentToArray($row['content_options'], $form);
$contentSettings = $this->contentConfigurationService->convertFlexFormContentToArray($row['content_options'], $form);
if (FALSE === isset($this->settings['content'])) {
$this->settings['content'] = $contentSettings;
} else {
Expand Down
27 changes: 22 additions & 5 deletions Classes/Provider/ContentProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class ContentProvider extends FluxContentProvider implements ProviderInterface {
/**
* @var ConfigurationService
*/
protected $configurationService;
protected $contentConfigurationService;

/**
* @param ConfigurationManagerInterface $configurationManager
Expand All @@ -75,8 +75,8 @@ public function injectConfigurationManager(ConfigurationManagerInterface $config
* @param ConfigurationService $configurationService
* @return void
*/
public function injectConfigurationService(ConfigurationService $configurationService) {
$this->configurationService = $configurationService;
public function injectContentConfigurationService(ConfigurationService $configurationService) {
$this->contentConfigurationService = $configurationService;
}

/**
Expand Down Expand Up @@ -128,7 +128,7 @@ public function getTemplatePathAndFilename(array $row) {
*/
public function getTemplatePaths(array $row) {
$extensionName = $this->getExtensionKey($row);
$paths = $this->configurationService->getContentConfiguration($extensionName);
$paths = $this->contentConfigurationService->getContentConfiguration($extensionName);
if (TRUE === is_array($paths) && FALSE === empty($paths)) {
$paths = PathUtility::translatePath($paths);
}
Expand Down Expand Up @@ -181,7 +181,7 @@ public function getControllerActionFromRecord(array $row) {
*/
public function getControllerActionReferenceFromRecord(array $row) {
$fileReference = $row['tx_fed_fcefile'];
return TRUE === empty($fileReference) ? 'Fluidcontent:index.html' : $fileReference;
return TRUE === empty($fileReference) ? 'Fluidcontent:error.html' : $fileReference;
}

/**
Expand All @@ -198,4 +198,21 @@ public function getPriority(array $row) {
return 0;
}

/**
* Get preview chunks - header and content - as
* array(string $headerContent, string $previewContent, boolean $continueRendering)
*
* @param array $row The record data to be analysed for variables to use in a rendered preview
* @return array
*/
public function getPreview(array $row) {

if ($this->contentObjectType !== $row['CType']) {
return array(NULL, NULL, TRUE);
}

$previewContent = $this->getPreviewView()->getPreview($this, $row);
return array(NULL, $previewContent, empty($previewContent));
}

}
6 changes: 4 additions & 2 deletions Classes/Service/ConfigurationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -345,11 +345,13 @@ protected function buildWizardTabItem($tabId, $id, $form, $templateFileIdentity)
$icon = substr($icon, 2);
}

if (TRUE === file_exists($icon) && TRUE === method_exists('FluidTYPO3\\Flux\\Utility\\MiscellaneousUtility', 'createIcon')) {
if (TRUE === method_exists('FluidTYPO3\\Flux\\Utility\\MiscellaneousUtility', 'createIcon')) {
if ('/' === $icon[0]) {
$icon = realpath(PATH_site . $icon);
}
$icon = '../..' . MiscellaneousUtility::createIcon($icon, $this->extConf['iconWidth'], $this->extConf['iconHeight']);
if (TRUE === file_exists($icon)) {
$icon = '../..' . MiscellaneousUtility::createIcon($icon, $this->extConf['iconWidth'], $this->extConf['iconHeight']);
}
}

return sprintf('
Expand Down
1 change: 1 addition & 0 deletions Configuration/TCA/Overrides/tt_content.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
'tx_fed_fcefile' => array(
'exclude' => 1,
'label' => 'LLL:EXT:fluidcontent/Resources/Private/Language/locallang.xml:tt_content.tx_fed_fcefile',
'displayCond' => 'FIELD:CType:=:fluidcontent_content',
'config' => array(
'type' => 'user',
'userFunc' => $contentSelector,
Expand Down
3 changes: 3 additions & 0 deletions Resources/Private/Language/locallang.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
<trans-unit id="tt_content.tx_fed_fcefile.emptyMessage">
<source>Fluid Content type not selected - edit this element in the TYPO3 backend to fix this!</source>
</trans-unit>
<trans-unit id="tt_content.tx_fed_fcefile.emptyMessageinBackend">
<source>Fluid Content type not selected - edit this element to fix this!</source>
</trans-unit>
</body>
</file>
</xliff>
56 changes: 56 additions & 0 deletions Resources/Private/Templates/Content/Error.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{namespace flux=FluidTYPO3\Flux\ViewHelpers}
<f:layout name="Content"/>
<f:section name="Configuration">
<flux:form id="error">
<flux:field.custom name="info">

<div class="alert alert-warning">
<div class="media">
<div class="media-left">
<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-exclamation fa-stack-1x"></i>
</span>
</div>
<div class="media-body">
<h4 class="alert-title">Warning</h4>

<div class="alert-message">
<f:translate key="tt_content.tx_fed_fcefile.emptyMessageinBackend"/>
</div>
</div>
</div>
</div>

</flux:field.custom>
</flux:form>
</f:section>

<f:section name="Preview">

<div class="alert alert-warning">
<div class="media">
<div class="media-left">
<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-exclamation fa-stack-1x"></i>
</span>
</div>
<div class="media-body">
<h4 class="alert-title">Warning</h4>

<div class="alert-message">
<f:translate key="tt_content.tx_fed_fcefile.emptyMessageinBackend"/>
</div>
</div>
</div>
</div>

</f:section>

<f:section name="Main">
<div style="background:#ff0; color:#000; padding: 20px; margin:20px;">
<f:translate key="tt_content.tx_fed_fcefile.emptyMessage"/>
<br> <br> Content uid: [{record.uid}]
</div>
</f:section>
39 changes: 39 additions & 0 deletions Tests/Unit/Backend/TableConfigurationPostProcessorTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php
namespace FluidTYPO3\Fluidcontent\Tests\Unit\Backend;

/*
* This file is part of the FluidTYPO3/Fluidcontent project under GPLv2 or later.
*
* For the full copyright and license information, please read the
* LICENSE.md file that was distributed with this source code.
*/

use FluidTYPO3\Fluidcontent\Backend\TableConfigurationPostProcessor;
use TYPO3\CMS\Core\Tests\UnitTestCase;

/**
* Class TableConfigurationPostProcessorTest
*/
class TableConfigurationPostProcessorTest extends UnitTestCase {

/**
* @test
*/
public function testGetConfigurationServiceReturnsConfigurationService() {
$instance = new TableConfigurationPostProcessor();
$result = $this->callInaccessibleMethod($instance, 'getConfigurationService');
$this->assertInstanceOf('FluidTYPO3\Fluidcontent\Service\ConfigurationService', $result);
}

/**
* @test
*/
public function testProcessData() {
$service = $this->getMock('FluidTYPO3\Fluidcontent\Service\ConfigurationService', array('getPageTsConfig'));
$service->expects($this->once())->method('getPageTsConfig')->willReturn('');
$instance = $this->getMock('FluidTYPO3\Fluidcontent\Backend\TableConfigurationPostProcessor', array('getConfigurationService'));
$instance->expects($this->once())->method('getConfigurationService')->willReturn($service);
$instance->processData();
}

}
14 changes: 0 additions & 14 deletions Tests/Unit/Controller/ContentControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,6 @@
class ContentControllerTest extends UnitTestCase {

public function testCreatesInstance() {
$GLOBALS['TYPO3_DB'] = $this->getMock(
'TYPO3\\CMS\\Core\\Database\\DatabaseConnection',
array('prepare_SELECTquery'),
array(), '', FALSE
);
$preparedStatementMock = $this->getMock(
'TYPO3\\CMS\\Core\\Database\\PreparedStatement',
array('execute', 'fetch', 'free'),
array(), '', FALSE
);
$preparedStatementMock->expects($this->any())->method('execute')->willReturn(FALSE);
$preparedStatementMock->expects($this->any())->method('free');
$preparedStatementMock->expects($this->any())->method('fetch')->willReturn(FALSE);;
$GLOBALS['TYPO3_DB']->expects($this->any())->method('prepare_SELECTquery')->willReturn($preparedStatementMock);
$instance = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager')
->get('FluidTYPO3\\Fluidcontent\\Controller\\ContentController');
$this->assertInstanceOf('FluidTYPO3\\Fluidcontent\\Controller\\ContentController', $instance);
Expand Down
Loading

0 comments on commit fd119d7

Please sign in to comment.