i've a content type called job, i want to show a local task as a tab on user page to simply let him adding a content from there. I've created the MYMODULE.links.task.yml file in my module with this content

  route_name: 'node.add'
    node_type: 'job'
  title: 'Add Job'
  base_route: entity.user.canonical

But it seems to throw an exception:

RuntimeException: Callable "Drupal\contact\Access\ContactPageAccess::access" requires a value for the "$user" argument. in Drupal\Component\Utility\ArgumentsResolver->handleUnresolvedArgument() (line 142 of /var/www/html/web/core/lib/Drupal/Component/Utility/ArgumentsResolver.php).

This is the WOSD i get: https://gyazo.com/ce67d2a124a4828e0016596d30a978a2

At the moment I've created my own route and the local task point to my custom route that make a redirect to /node/add/job, but I don't understand why my original task doesn't work. Any idea? Thanks!

Your Answer

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

Browse other questions tagged or ask your own question.