Skip to content

Commit 1b02a4b

Browse files
StijnStroobantspaul-m
StijnStroobants
authored andcommitted
Issue #2959773 by Mile23, StijnStroobants: All routing-paths should start with a leading slash
1 parent 64da459 commit 1b02a4b

23 files changed

+109
-57
lines changed

ajax_example/ajax_example.routing.yml

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
ajax_example.description:
2-
path: 'examples/ajax-example'
2+
path: '/examples/ajax-example'
33
defaults:
44
_controller: '\Drupal\ajax_example\Controller\AjaxExampleController::description'
55
_title: 'AJAX Example'
66
requirements:
77
_permission: 'access content'
88

99
ajax_example.simplest:
10-
path: 'examples/ajax-example/simplest'
10+
path: '/examples/ajax-example/simplest'
1111
defaults:
1212
_form: '\Drupal\ajax_example\Form\Simplest'
1313
_title: 'Simplest AJAX example'
1414
requirements:
1515
_permission: 'access content'
1616

1717
ajax_example.autotextfields:
18-
path: 'examples/ajax-example/autotextfields'
18+
path: '/examples/ajax-example/autotextfields'
1919
defaults:
2020
_form: '\Drupal\ajax_example\Form\Autotextfields'
2121
_title: 'Generate textfields'
2222
requirements:
2323
_permission: 'access content'
2424

2525
ajax_example.submit_driven_ajax:
26-
path: 'examples/ajax-example/submit-driven-ajax'
26+
path: '/examples/ajax-example/submit-driven-ajax'
2727
defaults:
2828
_form: '\Drupal\ajax_example\Form\SubmitDriven'
2929
_title: 'Submit-driven AJAX'
3030
requirements:
3131
_permission: 'access content'
3232

3333
ajax_example.dependent_dropdown:
34-
path: 'examples/ajax-example/dependent-dropdown/{nojs}'
34+
path: '/examples/ajax-example/dependent-dropdown/{nojs}'
3535
defaults:
3636
_form: '\Drupal\ajax_example\Form\DependentDropdown'
3737
_title: 'Dependent dropdown'
@@ -40,7 +40,7 @@ ajax_example.dependent_dropdown:
4040
_permission: 'access content'
4141

4242
ajax_example.dynamic_form_sections:
43-
path: 'examples/ajax-example/dynamic-form-sections/{nojs}'
43+
path: '/examples/ajax-example/dynamic-form-sections/{nojs}'
4444
defaults:
4545
_form: '\Drupal\ajax_example\Form\DynamicFormSections'
4646
_title: 'Dynamic form sections'
@@ -49,15 +49,15 @@ ajax_example.dynamic_form_sections:
4949
_permission: 'access content'
5050

5151
ajax_example.wizard:
52-
path: 'examples/ajax-example/wizard'
52+
path: '/examples/ajax-example/wizard'
5353
defaults:
5454
_form: '\Drupal\ajax_example\Form\Wizard'
5555
_title: 'Wizard with graceful degradation'
5656
requirements:
5757
_permission: 'access content'
5858

5959
ajax_example.wizardnojs:
60-
path: 'examples/ajax-example/wizard-nojs/{no_js_use}'
60+
path: '/examples/ajax-example/wizard-nojs/{no_js_use}'
6161
defaults:
6262
_form: '\Drupal\ajax_example\Form\Wizard'
6363
_title: 'Wizard with graceful degradation, w/JS turned off'
@@ -66,7 +66,7 @@ ajax_example.wizardnojs:
6666
_permission: 'access content'
6767

6868
ajax_example.ajax_link_render:
69-
path: 'examples/ajax-example/ajax-link-renderable'
69+
path: '/examples/ajax-example/ajax-link-renderable'
7070
defaults:
7171
_controller: '\Drupal\ajax_example\Controller\AjaxExampleController::renderLinkRenderableArray'
7272
_title: 'AJAX link from a render array'
@@ -78,7 +78,7 @@ ajax_example.ajax_link_render:
7878
# a way to know whether the request is an AJAX request or is from some other
7979
# source.
8080
ajax_example.ajax_link_callback:
81-
path: 'examples/ajax-example/ajax-link-callback/{nojs}'
81+
path: '/examples/ajax-example/ajax-link-callback/{nojs}'
8282
defaults:
8383
_controller: '\Drupal\ajax_example\Controller\AjaxExampleController::ajaxLinkCallback'
8484
# We provide a default value for {nojs}, so that it can be an optional
@@ -88,7 +88,7 @@ ajax_example.ajax_link_callback:
8888
_permission: 'access content'
8989

9090
ajax_example.autocomplete_user:
91-
path: 'examples/ajax_example/user_autocomplete'
91+
path: '/examples/ajax_example/user_autocomplete'
9292
defaults:
9393
_form: '\Drupal\ajax_example\Form\EntityAutocomplete'
9494
_title: 'Autocomplete users with entity_autocomplete.'

batch_example/batch_example.routing.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
batch_example.form:
2-
path: 'examples/batch_example'
2+
path: '/examples/batch_example'
33
defaults:
44
_form: '\Drupal\batch_example\Form\BatchExampleForm'
55
_title: 'Demo of batch processing'

cache_example/cache_example.routing.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cache_example.description:
2-
path: 'examples/cache-example'
2+
path: '/examples/cache-example'
33
defaults:
44
_form: '\Drupal\cache_example\Form\CacheExampleForm'
55
requirements:

content_entity_example/content_entity_example.routing.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ entity.content_entity_example_contact.delete_form:
5050
_entity_access: 'content_entity_example_contact.delete'
5151

5252
content_entity_example.contact_settings:
53-
path: 'admin/structure/content_entity_example_contact_settings'
53+
path: '/admin/structure/content_entity_example_contact_settings'
5454
defaults:
5555
_form: '\Drupal\content_entity_example\Form\ContactSettingsForm'
5656
_title: 'Contact settings'

dbtng_example/dbtng_example.routing.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
dbtng_example:
2-
path: 'examples/dbtng-example'
2+
path: '/examples/dbtng-example'
33
defaults:
44
_title: 'DBTNG Example'
55
_controller: '\Drupal\dbtng_example\Controller\DbtngExampleController::entryList'
66
requirements:
77
_permission: 'access content'
88

99
dbtng_list:
10-
path: 'examples/dbtng-example/list'
10+
path: '/examples/dbtng-example/list'
1111
defaults:
1212
_title: 'List'
1313
_controller: '\Drupal\dbtng_example\Controller\DbtngExampleController::entryList'
1414
requirements:
1515
_permission: 'access content'
1616

1717
dbtng_add:
18-
path: 'examples/dbtng-example/add'
18+
path: '/examples/dbtng-example/add'
1919
defaults:
2020
_title: 'Add entry'
2121
_form: '\Drupal\dbtng_example\Form\DbtngExampleAddForm'
2222
requirements:
2323
_permission: 'access content'
2424

2525
dbtng_update:
26-
path: 'examples/dbtng-example/update'
26+
path: '/examples/dbtng-example/update'
2727
defaults:
2828
_title: 'Update entry'
2929
_form: '\Drupal\dbtng_example\Form\DbtngExampleUpdateForm'
3030
requirements:
3131
_permission: 'access content'
3232

3333
dbtng_advanced:
34-
path: 'examples/dbtng-example/advanced'
34+
path: '/examples/dbtng-example/advanced'
3535
defaults:
3636
_title: 'Advanced list'
3737
_controller: '\Drupal\dbtng_example\Controller\DbtngExampleController::entryAdvancedList'

email_example/email_example.routing.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
email_example.description:
2-
path: 'examples/email-example'
2+
path: '/examples/email-example'
33
defaults:
44
_form: '\Drupal\email_example\Form\EmailExampleGetFormPage'
55
requirements:

events_example/events_example.routing.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Define a route for our event dispatching example.
22
events_example.description:
3-
path: 'examples/events-example'
3+
path: '/examples/events-example'
44
defaults:
55
_form: '\Drupal\events_example\Form\EventsExampleForm'
66
_title: 'Events Example'

field_example/field_example.routing.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Provides a simple user interface that tells the developer where to go.
22
field_example.description:
3-
path: 'examples/field-example'
3+
path: '/examples/field-example'
44
defaults:
55
_controller: '\Drupal\field_example\Controller\FieldExampleController::description'
66
requirements:

form_api_example/form_api_example.routing.yml

+11-11
Original file line numberDiff line numberDiff line change
@@ -11,55 +11,55 @@
1111
# Menu items corresponding to these URLs are defined separately in the
1212
# form_api_example.links.menu.yml file.
1313
form_api_example.description:
14-
path: 'examples/form-api-example'
14+
path: '/examples/form-api-example'
1515
defaults:
1616
_controller: '\Drupal\form_api_example\Controller\Page::description'
1717
_title: 'Form API Examples'
1818
requirements:
1919
_permission: 'access content'
2020

2121
form_api_example.simple_form:
22-
path: 'examples/form-api-example/simple-form'
22+
path: '/examples/form-api-example/simple-form'
2323
defaults:
2424
_form: '\Drupal\form_api_example\Form\SimpleForm'
2525
_title: 'Simple form'
2626
requirements:
2727
_permission: 'access content'
2828

2929
form_api_example.input_demo:
30-
path: 'examples/form-api-example/input-demo'
30+
path: '/examples/form-api-example/input-demo'
3131
defaults:
3232
_form: '\Drupal\form_api_example\Form\InputDemo'
3333
_title: 'Common input elements'
3434
requirements:
3535
_permission: 'access content'
3636

3737
form_api_example.state_demo:
38-
path: 'examples/form-api-example/state-demo'
38+
path: '/examples/form-api-example/state-demo'
3939
defaults:
4040
_form: '\Drupal\form_api_example\Form\StateDemo'
4141
_title: 'Form state binding'
4242
requirements:
4343
_permission: 'access content'
4444

4545
form_api_example.container_demo:
46-
path: 'examples/form-api-example/container-demo'
46+
path: '/examples/form-api-example/container-demo'
4747
defaults:
4848
_form: '\Drupal\form_api_example\Form\ContainerDemo'
4949
_title: 'Container elements'
5050
requirements:
5151
_permission: 'access content'
5252

5353
form_api_example.vertical_tabs_demo:
54-
path: 'examples/form-api-example/vertical-tabs-demo'
54+
path: '/examples/form-api-example/vertical-tabs-demo'
5555
defaults:
5656
_form: '\Drupal\form_api_example\Form\VerticalTabsDemo'
5757
_title: 'Vertical tab elements'
5858
requirements:
5959
_permission: 'access content'
6060

6161
form_api_example.modal_form:
62-
path: 'examples/form-api-example/modal-form/{nojs}'
62+
path: '/examples/form-api-example/modal-form/{nojs}'
6363
defaults:
6464
_form: '\Drupal\form_api_example\Form\ModalForm'
6565
_title: 'Modal form'
@@ -68,31 +68,31 @@ form_api_example.modal_form:
6868
_permission: 'access content'
6969

7070
form_api_example.ajax_color_demo:
71-
path: 'examples/form-api-example/ajax-color-demo'
71+
path: '/examples/form-api-example/ajax-color-demo'
7272
defaults:
7373
_form: '\Drupal\form_api_example\Form\AjaxColorForm'
7474
_title: 'AJAX color form'
7575
requirements:
7676
_permission: 'access content'
7777

7878
form_api_example.build_demo:
79-
path: 'examples/form-api-example/build-demo'
79+
path: '/examples/form-api-example/build-demo'
8080
defaults:
8181
_form: '\Drupal\form_api_example\Form\BuildDemo'
8282
_title: 'Build form demo'
8383
requirements:
8484
_permission: 'access content'
8585

8686
form_api_example.ajax_addmore:
87-
path: 'examples/form-api-example/ajax-addmore'
87+
path: '/examples/form-api-example/ajax-addmore'
8888
defaults:
8989
_form: '\Drupal\form_api_example\Form\AjaxAddMore'
9090
_title: 'Add-more button'
9191
requirements:
9292
_permission: 'access content'
9393

9494
form_api_example.multistep_form:
95-
path: 'examples/form-api-example/multistep-form'
95+
path: '/examples/form-api-example/multistep-form'
9696
defaults:
9797
_form: '\Drupal\form_api_example\Form\MultistepForm'
9898
_title: 'Multistep form'

hooks_example/hooks_example.routing.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# hooks_example only has one route. It is to a page explaining the module.
22
hooks_example.description:
3-
path: 'examples/hooks-example'
3+
path: '/examples/hooks-example'
44
defaults:
55
_controller: '\Drupal\hooks_example\Controller\HooksExampleController::description'
66
_title: 'Hooks Example'

menu_example/menu_example.routing.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ examples.menu_example.route_only.callback:
9090
# method. Matching the variable name is must. The {arg} element in the URL is
9191
# called a slug and is available as a $arg in the controller method.
9292
examples.menu_example.use_url_arguments:
93-
path: 'examples/menu-example/use-url-arguments/{arg1}/{arg2}'
93+
path: '/examples/menu-example/use-url-arguments/{arg1}/{arg2}'
9494
defaults:
9595
_title: 'URL Arguments'
9696
_controller: '\Drupal\menu_example\Controller\MenuExampleController::urlArgument'
@@ -103,7 +103,7 @@ examples.menu_example.use_url_arguments:
103103
# Title of this menu entry will be altered by controller method defined by
104104
# key '_title_callback'.
105105
examples.menu_example.title_callbacks:
106-
path: 'examples/menu-example/title-callbacks'
106+
path: '/examples/menu-example/title-callbacks'
107107
defaults:
108108
_title_callback: 'Drupal\menu_example\Controller\MenuExampleController::titleCallback'
109109
_controller: '\Drupal\menu_example\Controller\MenuExampleController::titleCallbackContent'
@@ -112,7 +112,7 @@ examples.menu_example.title_callbacks:
112112

113113
# A menu item entry to demonstrate use of parameters in routes.
114114
examples.menu_example.placeholder_argument:
115-
path: 'examples/menu-example/placeholder-argument'
115+
path: '/examples/menu-example/placeholder-argument'
116116
defaults:
117117
_title: 'Placeholder Arguments'
118118
_controller: '\Drupal\menu_example\Controller\MenuExampleController::placeholderArgs'
@@ -121,7 +121,7 @@ examples.menu_example.placeholder_argument:
121121

122122
# Parameters in routes can be used as placeholders arguments too.
123123
examples.menu_example.placeholder_argument.display:
124-
path: 'examples/menu-example/placeholder-argument/{arg}/display'
124+
path: '/examples/menu-example/placeholder-argument/{arg}/display'
125125
defaults:
126126
_title: 'Placeholder Arguments'
127127
_controller: '\Drupal\menu_example\Controller\MenuExampleController::placeholderArgsDisplay'
@@ -131,7 +131,7 @@ examples.menu_example.placeholder_argument.display:
131131

132132
# Any route defined here can be altered. We can do so by defining a RouteSubscriber!
133133
example.menu_example.path_override:
134-
path: 'examples/menu-example/menu-original-path'
134+
path: '/examples/menu-example/menu-original-path'
135135
defaults:
136136
_title: 'Menu path that will be altered'
137137
_controller: '\Drupal\menu_example\Controller\MenuExampleController::pathOverride'

node_type_example/node_type_example.routing.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
config_node_type_example.description:
2-
path: 'examples/node-type-example'
2+
path: '/examples/node-type-example'
33
defaults:
44
_controller: '\Drupal\node_type_example\Controller\NodeTypeExampleController::description'
55
requirements:

page_example/page_example.routing.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
# Access to this path is not restricted. This is notated as _access: 'TRUE'.
1717
page_example_description:
18-
path: 'examples/page-example'
18+
path: '/examples/page-example'
1919
defaults:
2020
_controller: '\Drupal\page_example\Controller\PageExampleController::description'
2121
_title: 'Page Example'
@@ -27,7 +27,7 @@ page_example_description:
2727
# find a match, and execute the _controller callback. Access to this path
2828
# requires "access simple page" permission.
2929
page_example_simple:
30-
path: 'examples/page-example/simple'
30+
path: '/examples/page-example/simple'
3131
defaults:
3232
_controller: '\Drupal\page_example\Controller\PageExampleController::simple'
3333
_title: 'Simple - no arguments'
@@ -48,7 +48,7 @@ page_example_simple:
4848
# function. The placeholder names "first" and "second" are arbitrary but must
4949
# match the variable names in the callback method, e.g. "$first" and "$second".
5050
page_example_arguments:
51-
path: 'examples/page-example/arguments/{first}/{second}'
51+
path: '/examples/page-example/arguments/{first}/{second}'
5252
defaults:
5353
_controller: '\Drupal\page_example\Controller\PageExampleController::arguments'
5454
requirements:

pager_example/pager_example.routing.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
pager_example.page:
2-
path: 'examples/pager-example'
2+
path: '/examples/pager-example'
33
defaults:
44
_controller: '\Drupal\pager_example\Controller\PagerExamplePage::getContent'
55
requirements:

phpunit_example/phpunit_example.routing.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# phpunit_example only has one route. It is to a page explaining
22
# the module.
33
phpunit_example_description:
4-
path: 'examples/phpunit-example'
4+
path: '/examples/phpunit-example'
55
defaults:
66
_controller: '\Drupal\phpunit_example\Controller\PHPUnitExampleController::description'
77
requirements:

queue_example/queue_example.routing.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
queue_example:
2-
path: 'examples/queue_example'
2+
path: '/examples/queue_example'
33
defaults:
44
_title: 'Queue Example'
55
_form: '\Drupal\queue_example\Forms\QueueExampleForm'

0 commit comments

Comments
 (0)