diff --git a/features/taxonomy/managing_taxons/editing_taxon_slug.feature b/features/taxonomy/managing_taxons/editing_taxon_slug.feature index 460006ac685..8bd42c75a50 100644 --- a/features/taxonomy/managing_taxons/editing_taxon_slug.feature +++ b/features/taxonomy/managing_taxons/editing_taxon_slug.feature @@ -26,7 +26,7 @@ Feature: Editing taxon's slug Then this taxon slug should be "mw" @ui @javascript - Scenario: Creating a taxon with an autogenerated slug for parent + Scenario: Creating a child taxon with an autogenerated slug Given the store has "Medieval weapons" taxonomy When I want to create a new taxon for "Medieval weapons" And I specify its code as "SIEGE_ENGINES" @@ -35,7 +35,7 @@ Feature: Editing taxon's slug Then this taxon slug should be "medieval-weapons/siege-engines" @ui - Scenario: Creating a taxon with a custom slug for parent + Scenario: Creating a child taxon with a custom slug Given the store has "Medieval weapons" taxonomy When I want to create a new taxon for "Medieval weapons" And I specify its code as "SIEGE_ENGINES" @@ -59,7 +59,7 @@ Feature: Editing taxon's slug Then the slug of the "Renaissance weapons" taxon should still be "medieval-weapons" @ui @javascript - Scenario: Automatically changing a taxon's slug while editing a taxon's name + Scenario: Automatically changing a root taxon's slug while editing a taxon's name Given the store has "Medieval weapons" taxonomy When I want to modify the "Medieval weapons" taxon And I enable slug modification @@ -68,7 +68,17 @@ Feature: Editing taxon's slug Then the slug of the "Renaissance weapons" taxon should be "renaissance-weapons" @ui @javascript - Scenario: Manually changing a taxon's slug while editing a taxon's name + Scenario: Automatically changing a child taxon's slug while editing a taxon's name + Given the store has "Medieval weapons" taxonomy + And the "Medieval weapons" taxon has child taxon "Pikes" + When I want to modify the "Pikes" taxon + And I enable slug modification + And I rename it to "Javelins" in "English (United States)" + And I save my changes + Then the slug of the "Javelins" taxon should be "medieval-weapons/javelins" + + @ui @javascript + Scenario: Manually changing a root taxon's slug while editing a taxon's name Given the store has "Medieval weapons" taxonomy When I want to modify the "Medieval weapons" taxon And I enable slug modification @@ -77,4 +87,13 @@ Feature: Editing taxon's slug And I save my changes Then the slug of the "Renaissance weapons" taxon should be "renaissance" - + @ui @javascript + Scenario: Manually changing a child taxon's slug while editing a taxon's name + Given the store has "Medieval weapons" taxonomy + And the "Medieval weapons" taxon has child taxon "Pikes" + When I want to modify the "Pikes" taxon + And I enable slug modification + And I rename it to "Javelins" in "English (United States)" + And I set its slug to "javelins" in "English (United States)" + And I save my changes + Then the slug of the "Javelins" taxon should be "javelins" diff --git a/src/Sylius/Bundle/AdminBundle/Resources/views/Taxon/_slugField.html.twig b/src/Sylius/Bundle/AdminBundle/Resources/views/Taxon/_slugField.html.twig index 5a02e9b02a3..b541cea194e 100644 --- a/src/Sylius/Bundle/AdminBundle/Resources/views/Taxon/_slugField.html.twig +++ b/src/Sylius/Bundle/AdminBundle/Resources/views/Taxon/_slugField.html.twig @@ -4,7 +4,7 @@ {{ form_widget(slugField, {'attr': {'data-url': path('sylius_admin_ajax_generate_taxon_slug'), 'data-parent': app.request.attributes.get('id')}}) }} {% else %}
- {{ form_widget(slugField, {'attr': {'readonly': 'readonly', 'data-url': path('sylius_admin_ajax_generate_taxon_slug')}}) }} + {{ form_widget(slugField, {'attr': {'readonly': 'readonly', 'data-url': path('sylius_admin_ajax_generate_taxon_slug'), 'data-parent': resource.parent ? resource.parent.id : null}}) }}