1

I am porting a module to Drupal 8. I have correctly setup the path in routing.yml but it always says access denied even I am logged in with user 1.

routing.yml

flood_control.flood_control_config_form:
  path: '/admin/config/flood-control'
  defaults:
    _form: '\Drupal\flood_control\Form\SettingsForm'
    _title: Flood Control
  requirement:
    _permission: 'administer site configuration'

.links.menu.yml

flood_control.flood_control_config_link:
  title: Configure Flood Control
  description: 'Configuration Form for flood control'
  parent: system.admin_config
  route_name: flood_control.flood_control_config_form

What am I missing wrong?

3

Can be just a typo, look at requirement, you missed a 's'.

  requirements:
    _permission: 'administer site configuration'

Look at here for a complete skeleton. (or a collection of modules examples here)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.