# This model sets the `system.site:page.front` config value to the home page
# node provided by the `drupal_cms_starter` recipe. The recipe has no way of
# knowing the system path (e.g., `node/40`) of the node when it's running
# config actions, but the `page.front` config value requires the system path,
# not an alias. Setting it to an alias makes any request to `<front>` redirect
# to `/home` (or whatever the node's alias is), rather than `/`. This model
# works around this limitation (bug?) in core.
# @see https://www.drupal.org/project/drupal_cms/issues/3493615
langcode: en
status: true
dependencies:
  config:
    - node.type.page
  module:
    - eca_config
    - eca_content
id: front_page_redirect_hotfix
modeller: bpmn_io
label: 'Front page redirect hotfix'
version: 1.0.0
weight: 0
events:
  Event_insert_basic_page:
    plugin: 'content_entity:insert'
    label: 'Insert basic page'
    configuration:
      type: 'node page'
    successors:
      -
        id: Activity_set_home_path
        condition: Flow_is_home
conditions:
  Flow_is_home:
    plugin: eca_entity_field_value
    configuration:
      negate: false
      case: false
      expected_value: e939b485-ca10-4061-9036-3d6d394d7214
      field_name: uuid
      operator: equal
      type: value
      entity: node
gateways: {  }
actions:
  Activity_set_home_path:
    plugin: eca_config_write
    label: 'Set home path'
    configuration:
      config_value: '/node/[node:nid]'
      use_yaml: false
      save_config: true
      config_name: system.site
      config_key: page.front
    successors: {  }
