Configured custom routes are not persistent

Created on 9 April 2019, about 5 years ago
Updated 7 October 2023, 9 months ago

I have disabled the default path: "user/register".

I have configured custom paths for my two role based registration pages. It have set them as "login/role1" and "login/role2".
I have exported my configuration and this is the result:

multiple_registration_path_role1: login/role1
multiple_registration_url_role1: /user/register/role1
multiple_registration_hidden_role1: 1
multiple_registration_form_mode_register_role1: register
multiple_registration_form_mode_edit_role1: default
multiple_registration_path_role2: login/role2
multiple_registration_url_role2: /user/register/role2
multiple_registration_hidden_role2: 1
multiple_registration_form_mode_register_role2: register
multiple_registration_form_mode_edit_role2: default

During the development cycle I am re-installing from this exported config from time to time. When I do I get access denied on the routes "login/role1" and "login/role2" while "/user/register/role1" and "/user/register/role2" both work. It seems that the exported config for the routes is not being imported?

It sounds like a similar issue was reported against the D7 version but I don't know how much of the code is common: https://www.drupal.org/project/multiple_registration/issues/2754673 β†’

It seems to me that if we want to provide custom paths for registration pages in this module we need to provide a route_callback in routing.yml? (Going by https://www.drupal.org/node/2122201 β†’ ) At the moment there is just a hardcoded section:

multiple_registration.role_registration_page:
  path: 'user/register/{rid}'
  defaults:
    _entity_form: 'user.register'
    _title_callback: '\Drupal\multiple_registration\Controller\MultipleRegistrationController::getRegisterPageTitle'
  requirements:
    _custom_access: '\Drupal\multiple_registration\Controller\MultipleRegistrationController::access'
πŸ› Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada lolcode

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡§πŸ‡ΎBelarus gun2dru
  • πŸ‡§πŸ‡ΎBelarus gun2dru
  • πŸ‡§πŸ‡ΎBelarus gun2dru

    Hi there,
    Looks like the issue happened in export process.
    The issue is not reproducing when we export the full list of configs arising in the process of working with this module:

    • multiple_registration.access_settings_page_form_config
    • multiple_registration.common_settings_page_form_config
    • multiple_registration.create_registration_page_form_config
    • system.action.user_add_role_action.role1
    • system.action.user_add_role_action.role2
    • system.action.user_remove_role_action.role1
    • system.action.user_remove_role_action.role2
    • user.role.role1
    • user.role.role2

    After the configuration import, items on /admin/config/people/multiple_registration page are existed and forms are available.

    multiple_registration.create_registration_page_form_config.yml

    roles:
      role1:
        path: /login/role1
        url: /user/register/role1
        redirect_path: /
        hidden: 0
        form_mode_register: register
        form_mode_edit: default
      role2:
        path: /login/role2
        url: /user/register/role2
        redirect_path: /
        hidden: 0
        form_mode_register: register
        form_mode_edit: default
    
  • Status changed to Needs review 9 months ago
  • πŸ‡§πŸ‡ΎBelarus gun2dru
  • Status changed to RTBC 9 months ago
  • πŸ‡ΊπŸ‡¦Ukraine ysamoylenko

    @gun2dru thank you for providing your test results.

    You are right, starting from the module version configuration schema of the module has changed.

    As I can see the issue was created on 9 Apr 2019, so a lot of changes were applied to the module from that time.

    If you are using an outdated version of the module please create a DB backup before the module upgrade, then pull a new version and run "drush updb", all outdated configurations will be upgraded to the new configuration schema format.

  • Status changed to Fixed 9 months ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024