Details
-
Bug
-
Resolution: Fixed
-
High
-
2.5.8
-
None
Description
When command ezplatform:cron:run is executed parameter --siteaccess is not passed to the jobs and this can cause unexpected results (example: wrong connection being used in multi-repository setups).
Steps to reproduce
1. Clean installation of eZ Platform EE 2.5.8
2. Add second connection:
app/config/config.yml
doctrine: dbal: connections: default: driver: '%database_driver%' host: '%database_host%' port: '%database_port%' dbname: '%database_name%' user: '%database_user%' password: '%database_password%' charset: '%database_charset%' server_version: '%database_version%' second: driver: '%database_driver%' host: '%database_host%' port: '%database_port%' dbname: '%database_name%-2' user: '%database_user%' password: '%database_password%' charset: '%database_charset%' server_version: '%database_version%'
app/config/ezplatform.yml
ezpublish: http_cache: purge_type: '%purge_type%' repositories: default: storage: engine: legacy connection: default config: {} search: connection: default second: storage: engine: legacy connection: second config: {} search: connection: second siteaccess: list: [site, admin, admin2] groups: site_group: [site] admin_group: [admin, admin2] default_siteaccess: site match: URIElement: 1 system: default: cache_service_name: '%cache_pool%' var_dir: var/retail content: default_ttl: '%httpcache_default_ttl%' http_cache: purge_servers: ['%purge_server%'] varnish_invalidate_token: '%varnish_invalidate_token%' fastly: service_id: '%fastly_service_id%' key: '%fastly_key%' admin_group: languages: [eng-GB] page_builder: siteaccess_list: [site] content_tree_module: contextual_tree_root_location_ids: - 2 # Home (Content structure) - 5 # Users - 43 # Media - 48 # Setup - 55 # Forms subtree_paths: content: /1/2/ media: /1/43/ admin: repository: default cache_service_name: 'cache.tagaware.filesystem' admin2: repository: second cache_service_name: 'cache.tagaware.filesystem2' site: languages: [eng-GB] url_alias: slug_converter: transformation: 'urlalias_lowercase' ez_platform_standard_design: override_kernel_templates: false
app/config/cache_pool/cache.tagaware.filesystem.yml
services: cache.tagaware.filesystem: class: Symfony\Component\Cache\Adapter\TagAware\FilesystemTagAwareAdapter parent: cache.adapter.filesystem tags: - name: cache.pool clearer: cache.app_clearer namespace: '%cache_namespace%' cache.tagaware.filesystem2: class: Symfony\Component\Cache\Adapter\TagAware\FilesystemTagAwareAdapter parent: cache.adapter.filesystem tags: - name: cache.pool clearer: cache.app_clearer namespace: '%cache_namespace%2'
3. Log in to the backoffice in admin2 SiteAccess (repository: second) and in "Home" create "Test" Folder. Use "Publish later" feature, set current date and time.
4. From your project root directory execute:
php bin/console ezplatform:cron:run --siteaccess=admin2
Result
"Test" folder won't be published, as the wrong SiteAccess (and by extension wrong connection) is used for ezstudio:scheduled:publish job.
Expected Result
"Test" folder is published normally.