Skip to content

Commit

Permalink
EZEE-1900: Installer fails if auto_increment_increment != 1 (ezsystem…
Browse files Browse the repository at this point in the history
…s#51)

* EZEE-1900: Installer fails if auto_increment_increment != 1

https://jira.ez.no/browse/EZEE-1900
  • Loading branch information
damianz5 committed Mar 22, 2018
1 parent df7e032 commit fe121e6
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 6 deletions.
6 changes: 6 additions & 0 deletions app/config/default_parameters.yml
Expand Up @@ -132,6 +132,11 @@ parameters:
app.search.list.limit: 10
app.search.list.content_types: ['article', 'place', 'blog_post', 'product']

app.migration_reference_file: '/src/AppBundle/MigrationVersions/References/references_all.yml'

app.migration.values_mapping:
userprofiling_block.config.tags_subtree_limit: 'ref_tag_user_segments'

#menu.default.menucontentsettings.topidentifierlist: [landing_page, blog, about, subscribe, product_list]
menu.default.menucontentsettings.topidentifierlist: [landing_page, folder, blog, about, subscribe, product_list]

Expand All @@ -147,3 +152,4 @@ parameters:
eztags.default.tag_view.pagelayout: '::pagelayout.html.twig'

userprofiling_block.public_dir: 'bundles/app'
userprofiling_block.config.tags_subtree_limit: 513
7 changes: 7 additions & 0 deletions app/config/services/app.yml
Expand Up @@ -127,3 +127,10 @@ services:
- '@ezpublish.api.service.tags'
tags:
- { name: landing_page_field_type.block_type, alias: userprofiling }

# User Profiling configuration provider
EzSystems\EzPlatformAdminUi\UI\Config\Provider\Value:
arguments:
- '%userprofiling_block.config.tags_subtree_limit%'
tags:
- { name: ezplatform.admin_ui.config_provider, key: 'userProfilingBlockSubTreeLimit' }
7 changes: 7 additions & 0 deletions src/AppBundle/AppBundle.php
Expand Up @@ -2,8 +2,15 @@

namespace AppBundle;

use AppBundle\DependencyInjection\Compiler\MigrationParameterPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;

class AppBundle extends Bundle
{
public function build(ContainerBuilder $container)
{
parent::build($container);
$container->addCompilerPass(new MigrationParameterPass());
}
}
@@ -0,0 +1,36 @@
<?php
/**
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
namespace AppBundle\DependencyInjection\Compiler;

use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Yaml\Yaml;

class MigrationParameterPass implements CompilerPassInterface
{
/*
* Loads migration result file to parameters if present.
*/
public function process(ContainerBuilder $container)
{
$referenceFile = $container->getParameter('kernel.project_dir') . $container->getParameter('app.migration_reference_file');
$migrationValuesMapping = $container->getParameter('app.migration.values_mapping');

if (!is_readable($referenceFile)) {
return;
}

$references = Yaml::parseFile($referenceFile);

foreach ($migrationValuesMapping as $parameterName => $migrationParameterName) {
if (!array_key_exists($migrationParameterName, $references)) {
continue;
}

$container->setParameter($parameterName, $references[$migrationParameterName]);
}
}
}
6 changes: 1 addition & 5 deletions src/AppBundle/MigrationVersions/users.yml
Expand Up @@ -125,13 +125,9 @@
field-settings:
hideRootTag: false
editView: Default
# subTreeLimit: reference:ref_tag_user_segments
validator-configuration:
TagsValueValidator:
# TODO: change to reference when merged https://github.com/kaliop-uk/ezmigrationbundle/pull/133
subTreeLimit: 513
#subTreeLimit: reference:ref_tag_user_segments
#subTreeLimit: tag_keyword:'User Segments'
subTreeLimit: reference:ref_tag_user_segments
references:
-
identifier: ref_content_type_id__user
Expand Down
Expand Up @@ -134,7 +134,7 @@ YUI.add('up-itemsfieldview', function (Y) {
jQuery(selector).EzTags({
autocompleteUrl: window.Routing.generate('netgen_tags_admin_autocomplete'),
maxTags: 1,
subtreeLimit: 513,
subtreeLimit: window.eZ.adminUiConfig.userProfilingBlockSubTreeLimit,
hideRootTag: 1,
sortable: false,
translations: {
Expand Down

0 comments on commit fe121e6

Please sign in to comment.