Skip to content

Commit

Permalink
Merge branch 'development' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
bjo3rnf committed May 20, 2015
2 parents cb5c90f + 452926f commit 4b6eea3
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 19 deletions.
9 changes: 4 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
# Fluidpages Change log

3.2.2 - 2015-04-26
------------------

- Bugfix for subpage configuration always being used
- https://github.com/FluidTYPO3/fluidpages/commit/66ad2bfc1bd42f4c377cec39829d77d5fef601c7
- [Source commit with more info](https://github.com/FluidTYPO3/fluidpages/commit/66ad2bfc1bd42f4c377cec39829d77d5fef601c7)

3.2.1 - 2015-04-23
------------------

- Bugfixes for incorrectly resolved main/sub provider and template resulting in use of wrong page configuration and broken inheritance
- https://github.com/FluidTYPO3/fluidpages/pull/252
- [#252](https://github.com/FluidTYPO3/fluidpages/pull/252) Bugfix for incorrectly resolved main/sub provider and template resulting in use of wrong page configuration and broken inheritance

- Bugfix for saving incomplete page records when working in the page tree or access module
- https://github.com/FluidTYPO3/fluidpages/commit/91b748ef97893a462cac28183c5d69d70f5b4d5e
- [#241](https://github.com/FluidTYPO3/fluidpages/pull/241) Bugfix for saving incomplete page records when working in the page tree or access module

3.2.0 - 2015-03-18
------------------
Expand Down
39 changes: 25 additions & 14 deletions Classes/Provider/PageProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ class PageProvider extends AbstractProvider implements ProviderInterface {
*/
protected $configurationService;

/**
* @var array
*/
private static $cache = array();

/**
* CONSTRUCTOR
*/
Expand Down Expand Up @@ -298,22 +303,28 @@ protected function setDefaultValuesInFieldsWithInheritedValues(Form $form, array
* @return array
*/
protected function getInheritedConfiguration(array $row) {
$tree = $this->getInheritanceTree($row);
$data = array();
foreach ($tree as $branch) {
$provider = $this->configurationService->resolvePrimaryConfigurationProvider($this->tableName, self::FIELD_NAME_SUB, $branch);
$form = $provider->getForm($branch);
if (NULL === $form) {
return $data;
}
$fields = $form->getFields();
$values = $provider->getFlexFormValuesSingle($branch);
foreach ($fields as $field) {
$values = $this->unsetInheritedValues($field, $values);
$tableName = $this->getTableName($row);
$tableFieldName = $this->getFieldName($row);
$cacheKey = $tableName . $tableFieldName . $row['uid'];
if (TRUE === empty(self::$cache[$cacheKey])) {
$tree = $this->getInheritanceTree($row);
$data = array();
foreach ($tree as $branch) {
$provider = $this->configurationService->resolvePrimaryConfigurationProvider($this->tableName, self::FIELD_NAME_SUB, $branch);
$form = $provider->getForm($branch);
if (NULL === $form) {
break;
}
$fields = $form->getFields();
$values = $provider->getFlexFormValuesSingle($branch);
foreach ($fields as $field) {
$values = $this->unsetInheritedValues($field, $values);
}
$data = RecursiveArrayUtility::merge($data, $values);
}
$data = RecursiveArrayUtility::merge($data, $values);
self::$cache[$cacheKey] = $data;
}
return $data;
return self::$cache[$cacheKey];
}

/**
Expand Down

0 comments on commit 4b6eea3

Please sign in to comment.