Some mandatory parameters are missing ("webform") to generate a URL for route

Created on 23 July 2024, 4 months ago
Updated 21 August 2024, 3 months ago

Problem/Motivation

when tried to check the submissions,the page went wrong and alerted:

The website encountered an unexpected error. Try again later.

Symfony\Component\Routing\Exception\MissingMandatoryParametersException: Some mandatory parameters are missing ("webform") to generate a URL for route "layout_builder.overrides.webform_submission.view". in Drupal\Core\Routing\UrlGenerator->doGenerate() (line 187 of core/lib/Drupal/Core/Routing/UrlGenerator.php).

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

💬 Support request
Status

Active

Version

6.2

Component

Miscellaneous

Created by

🇦🇺Australia jjwfcd

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

Comments & Activities

  • Issue created by @jjwfcd
  • 🇺🇸United States Kristi_06

    Also experiencing this error.

  • 🇦🇺Australia jjwfcd

    find that from webform.module from line 258 but dont know why it does not work

    // ISSUE:
    // Devel routes do not use 'webform' parameter which throws the below error.
    // Some mandatory parameters are missing ("webform") to generate a URL for
    // route "entity.webform_submission.canonical"
    //
    // WORKAROUND:
    // Make sure webform parameter is set for all routes.
    if (strpos($route_name, 'entity.webform_submission.devel_') === 0 || $route_name === 'entity.webform_submission.token_devel') {
    foreach ($data['tabs'] as $tab_level) {
    foreach ($tab_level as $tab) {
    /** @var \Drupal\Core\Url $url */
    $url = $tab['#link']['url'];
    $tab_route_name = $url->getRouteName();
    $tab_route_parameters = $url->getRouteParameters();

    if (strpos($tab_route_name, 'entity.webform_submission.devel_') !== 0) {
    $webform_submission = WebformSubmission::load($tab_route_parameters['webform_submission']);
    $url->setRouteParameter('webform', $webform_submission->getWebform()->id());
    }
    }
    }
    }

  • 🇦🇺Australia jjwfcd

    upgrade to webform 6.2.7 it does not work also

  • 🇦🇺Australia jjwfcd

    if a form has no submission, it works fine.
    after submitted one test submission, it does not work.

  • 🇳🇱Netherlands ckspringbok

    I got the same problem and was in need to report results so I had to pull the results from the database. A view to report seems also possible.

    SELECT subm.serial, subm.remote_addr, subm.sid, submdata.name, submdata.property, submdata.delta, submdata.value 
    FROM webform_submission as subm 
    INNER JOIN webform_submission_data as submdata 
    ON submdata.sid=subm.sid 
    WHERE subm.webform_id='<<webform_id>>’;
Production build 0.71.5 2024