Case 1:

  1. Changee some node configuration (admin/config/services/jsonapi)
  2. Export configuration (drush cex)
  3. Exported the configuration in features
  4. Reinstall the website from configuration (drush site-install --account-name=admin --account-pass=admin --account-mail=test@example.com -y --config-dir=../config/sync standart)
  5. See the error:

Symfony\Component\Routing\Exception\MissingMandatoryParametersException: Some mandatory parameters are missing ("entity_type_id", "bundle") to generate a URL for route [error]
"entity.jsonapi_resource_config.add_form". in /var/www/html/docroot/core/lib/Drupal/Core/Routing/UrlGenerator.php:183

The error will remain if you do "drush cim" afterwards.

Case 2:

  1. New standard site installation with jsonapi_extras.
  2. Go to the admin/config/services/jsonapi page and Override the article and Save.
  3. Revert the article.
  4. Got the following error:
  5. Symfony\Component\Routing\Exception\MissingMandatoryParametersException: Some mandatory parameters are missing ("entity_type_id", "bundle") to generate a URL for route "entity.jsonapi_resource_config.add_form". in Drupal\Core\Routing\UrlGenerator->doGenerate() (line 182 of /Users/....../core/lib/Drupal/Core/Routing/UrlGenerator.php).
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

a.milkovsky created an issue. See original summary.

a.milkovsky’s picture

Issue summary: View changes
a.milkovsky’s picture

Issue summary: View changes
a.milkovsky’s picture

Title: Some mandatory parameters are missing ("entity_type_id", "bundle") » Some mandatory parameters are missing ("entity_type_id", "bundle") when exported in featires
Issue summary: View changes
e0ipso’s picture

Title: Some mandatory parameters are missing ("entity_type_id", "bundle") when exported in featires » Some mandatory parameters are missing ("entity_type_id", "bundle") when exported in features
e0ipso’s picture

Status: Active » Postponed (maintainer needs more info)

@a.milkovsky did you narrow the problem down to features? Do we want to move the issue to that project's issue queue?

a.milkovsky’s picture

@e0ipso, I have indeed narrowed the problem. It only happens when the JSON API config is included into features. I am not sure if it is a bug of the features module, as all the other configs work fine.
Have you tried to reproduce the bug?

mkolar’s picture

I can confirm what @a.milkovsky said. All features works except features with jsonapi_extras configs I would think its not bug of features.

janoka’s picture

I did the following:

  1. New standard site installation with jsonapi_extras.
  2. Go to the admin/config/services/jsonapi page and Override the article and Save.
  3. Revert the article.
  4. Got the following error:
    Symfony\Component\Routing\Exception\MissingMandatoryParametersException: Some mandatory parameters are missing ("entity_type_id", "bundle") to generate a URL for route "entity.jsonapi_resource_config.add_form". in Drupal\Core\Routing\UrlGenerator->doGenerate() (line 182 of /Users/....../core/lib/Drupal/Core/Routing/UrlGenerator.php).
janoka’s picture

Status: Postponed (maintainer needs more info) » Active
a.milkovsky’s picture

Title: Some mandatory parameters are missing ("entity_type_id", "bundle") when exported in features » Some mandatory parameters are missing ("entity_type_id", "bundle") when reverting config
Issue summary: View changes
mkolar’s picture

this is big problem for me currently.. on one of my projects with jsonapi im not able to uninstall my module (it has custom entities and those entities endpoints are disabled with jsonapi_extras) even jsonapi_extras cant be uninstalled at the moment..

...:/var/www/html$ drush pm-uninstall jsonapi_extras -y
The following extensions will be uninstalled: jsonapi_extras

 // Do you want to continue?: yes.

 [error]  Some mandatory parameters are missing ("entity_type_id", "bundle") to generate a URL for route "entity.jsonapi_resource_config.add
_form".
a.milkovsky’s picture

Priority: Normal » Major

Changed to major, as the bug blocks module uninstall.

e0ipso’s picture

It seems that the reproduction steps are clearer now. Thanks for the work. Hopefully that will make it easy for people to provide a patch for this.

janoka’s picture

@a.milkovsky,

Changed to major, as the bug blocks module uninstall.

Also blocks the configuration update at the related content types.

mkolar’s picture

Guys i cant figure it out how to fix it... removing line below works but its not solution, I was trying to look to entities which also have variables in its links (for example vocabulary) to check if there is anything special but without luck
"add-form" = "/admin/config/services/jsonapi/add/{entity_type_id}/{bundle}"

e0ipso’s picture

Thanks for giving this a try @mkolar. I don't have time to look into this, but I'm sure that information will help someone to move forward. Every bit of info matters.

imfaber’s picture

I think the add form link should simply be the following:

"add-form" = "/admin/config/services/jsonapi/add"

Not sure what entity_type_id and bundle are for but without them it seems to behave properly.

mkolar’s picture

Without This adding new override won’t work. Existing will stay functional...

janoka’s picture

I think the add form link should simply be the following:

"add-form" = "/admin/config/services/jsonapi/add"

Not sure what entity_type_id and bundle are for but without them it seems to behave properly.

@imfaber, thanks for your idea!

I checked you proposal. I try to create a new override and got an "Page not found" message.
The slug was that: admin/config/services/jsonapi/add?entity_type_id=node&bundle=page
BTW, thanks!

imfaber’s picture

That's weird.
I seem to be able to create overrides.
In fact, after changing the link as above and rebuilding the cache I'm able to create overrides, revert them, uninstall the module etc..

I'll try digging deeper.

imfaber’s picture

Ah hold on.

I try to create a new override and got an "Page not found" message.

Only now I realise that was referred to the actual resource.
Yeah I can reproduce that so ignore my message above.

imfaber’s picture

I believe this patch mutes the error above and does not affect the module functionality.

Regarding the "Page not found", when I create an override I need to rebuild the cache in order to get the new routes in place but I think that's a different issue.

imfaber’s picture

Status: Active » Needs review
janoka’s picture

I have tested and worked for me perfectly.
I propose to merge in the changes.

@imfaber, thank you so much for your effort, you did a grate work!

janoka’s picture

@e0ipso, how many test required from the community? I recommend to change the status to "RTBC".

mkolar’s picture

I Can check it next week..

  • e0ipso committed 090c4fb on 8.x-1.x authored by imfaber
    Issue #2922244 by imfaber: Some mandatory parameters are missing ("...
e0ipso’s picture

Status: Needs review » Fixed

I tested this and it works properly. Thanks for the fix!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

a.milkovsky’s picture