After creating a entity browser using the UI I get this error when visiting /admin/config/content/entity_browser:

Symfony\Component\Routing\Exception\MissingMandatoryParametersException: Some mandatory parameters are missing ("machine_name", "step") to generate a URL for route "entity.entity_browser.config_translation_overview". in Drupal\Core\Routing\UrlGenerator->doGenerate() (line 177 of /core/lib/Drupal/Core/Routing/UrlGenerator.php).

Comments

Lukas von Blarer created an issue. See original summary.

slashrsm’s picture

There was similar report in #2512702: Implement configuration UI. I tried to reproduce but was not successful. It would be great if you could share your steps.

rene bakx’s picture

I have the same issue. I have a drupal 8.0.4 site with two languages enabled and got this module as a dependency on the file_browser module. I suspect the issue is a combination between multilanguage and the config of the settings the file-browser comes with.

Will see if I have some time to investigate my suspicion, can not make a promise it will be this week :)

slashrsm’s picture

Issue tags: +Media Initiative, +D8Media
StatusFileSize
new672 bytes

I was finally able to reproduce. This happens if config_translation module is enabled. List of entity browsers will appear with this patch, but translation pages still won't work. I think we'd need to re-think how we handle this. I will check if form wizard allows us to use a more standard naming of parameters in routes.

killua99’s picture

Oh I didn't knew about this issue, I'm gonna try the patch later.

killua99’s picture

Ok, the patch 3 solve the callback. Yes I have enable the config_translation module

luksak’s picture

Status: Active » Reviewed & tested by the community

Yes, I also had config_translation enabled. The patch fixed the issue.

slashrsm’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new7.74 KB

Different approach which I prefer over #4.

eclipsegc’s picture

Looks like maybe there were some unrelated changes in that patch, so I assume this does an upcasting of the entity? Any big benefits of this? should the Entity Wizard in ctools consider adopting this approach?

Eclipse

Status: Needs review » Needs work

The last submitted patch, 8: 2675390_8.patch, failed testing.

The last submitted patch, 8: 2675390_8.patch, failed testing.

slashrsm’s picture

Status: Needs work » Needs review
StatusFileSize
new8.87 KB
new1.13 KB

This should fix tests.

@EclipseGC: Main issue was the fact that wizard uses "machine_name" for the argument while content_transliation (and possibly others?) on the other hand expects entity type name. This mismatch caused fatals when generating URLs.

EDIT: Yes, this feels like something that could belong in form wizard itself.

arknoll’s picture

Status: Needs review » Reviewed & tested by the community

This patch worked for me. Marking RTBC

esolitos’s picture

I can confirm that the patch is working also for me on a few different sites (both multilingual and not), great job!

esolitos’s picture

Just a question to @slashrsm about patch from #12, it works fine but:

+++ b/src/Entity/EntityBrowser.php
@@ -1,10 +1,5 @@
-/**
- * @file
- * Contains \Drupal\entity_browser\Entity\EntityBrowser.
- */
-

Why all those "@file Contains" removals?

  • slashrsm committed 5b72762 on 8.x-1.x
    Issue #2675390 by slashrsm, Lukas von Blarer, killua99, arknoll,...
slashrsm’s picture

Status: Reviewed & tested by the community » Fixed

We could probably solve this in a nicer way, but it works and I won't have time to look more into this in a foreseeable future.

Thank you all for your feedback.

@esolitos: Those comment blocks are not required any more by the coding standard.

Status: Fixed » Closed (fixed)

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

yoruvo’s picture

Status: Closed (fixed) » Active

I continue to receive this error with the newest development version of the module.

On route /admin/config/content/entity_browser/file_entity_browser_single_image/general/translate

The website encountered an unexpected error. Please try again later.

Symfony\Component\Routing\Exception\MissingMandatoryParametersException: Some mandatory parameters are missing ("step") to generate a URL for route "entity.entity_browser.config_translation_overview". in Drupal\Core\Routing\UrlGenerator->doGenerate() (line 171 of core/lib/Drupal/Core/Routing/UrlGenerator.php).
Drupal\Core\Routing\UrlGenerator->getInternalPathFromRoute('entity.entity_browser.config_translation_overview', Object, Array) (Line: 124)
Drupal\Core\Routing\UrlGenerator->getPathFromRoute('entity.entity_browser.config_translation_overview', Array) (Line: 68)
Drupal\Core\Render\MetadataBubblingUrlGenerator->getPathFromRoute('entity.entity_browser.config_translation_overview', Array) (Line: 772)
Drupal\Core\Url->getInternalPath() (Line: 250)
Drupal\config_translation\ConfigNamesMapper->getOverviewPath() (Line: 212)
Drupal\config_translation\Controller\ConfigTranslationController->itemPage(Object, Object, 'entity_browser')
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 574)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
call_user_func_array(Object, Array) (Line: 139)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 62)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 628)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
drholera’s picture

I have the same issue as @ivi.arocom in #19. Any updates on it?

gngn’s picture

I am using entity_browser 8.x-1.0 (and config_translation) with two enabled languages.

Coming from admin/config/content/entity_browser and selecting "Translate" I am directed to
admin/config/content/entity_browser/image_browser/general/translate where I get
"The website encountered an unexpected error. Please try again later."

In the error_log I have:
PHP Exception Symfony\Component\Routing\Exception\MissingMandatoryParametersException:
"Some mandatory parameters are missing ("step") to generate a URL for route "entity.entity_browser.config_translation_overview"."
at [...]/drupal/web/core/lib/Drupal/Core/Routing/UrlGenerator.php line 171

Any ideas?

Update: the original error had missing ("machine_name", "step") while (like #19) only get missing ("step").

kkri’s picture

I am also having the same issue as described in #21.

urlRouteParameters() is not being called when you try to translate an entity browser, I think this should be solved by an alterRoutes() call.

handkerchief’s picture

Version: 8.x-1.x-dev » 8.x-1.3

Same problem here:

The website encountered an unexpected error. Please try again later.Symfony\Component\Routing\Exception\MissingMandatoryParametersException: Some mandatory parameters are missing ("step") to generate a URL for route "entity.entity_browser.config_translation_overview". in Drupal\Core\Routing\UrlGenerator->doGenerate() (line 180 of core/lib/Drupal/Core/Routing/UrlGenerator.php).

Drupal\Core\Routing\UrlGenerator->getInternalPathFromRoute('entity.entity_browser.config_translation_overview', Object, Array) (Line: 131)
Drupal\Core\Routing\UrlGenerator->getPathFromRoute('entity.entity_browser.config_translation_overview', Array) (Line: 68)
Drupal\Core\Render\MetadataBubblingUrlGenerator->getPathFromRoute('entity.entity_browser.config_translation_overview', Array) (Line: 790)
Drupal\Core\Url->getInternalPath() (Line: 248)
Drupal\config_translation\ConfigNamesMapper->getOverviewPath() (Line: 212)
Drupal\config_translation\Controller\ConfigTranslationController->itemPage(Object, Object, 'entity_browser')
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 576)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
call_user_func_array(Object, Array) (Line: 153)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 50)
Drupal\ban\BanMiddleware->handle(Object, 1, 1) (Line: 60)
Drupal\shield\ShieldMiddleware->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 657)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
rodrigoaguilera’s picture

Version: 8.x-1.3 » 8.x-2.x-dev

Is good to know that you are experiencing this issue in the 1.3 version but it should be fixed in the dev branch.

Actually someone should confirm first if this happens in the 2.x-dev branch of the module.

handkerchief’s picture

Issue tags: +file entity browser

I have tested it. Exactly the same error message appears if I want to translate an entity browser.

Drupal Core: 8.4.0
Entity Browser: 8.x-2.x-dev, 8.x-1.3
File Browser: 8.x-1.1+16-dev

Interesting, if I want to translate a file browser (Browser for files), a "access denied" message appears, but I'm logged in as the main administrator with all permissions.

But for all other Entity Browsers that I have created, the "Some mandatory parameters are missing..." error appears.

sistocarta’s picture

I have the same issue.

Drupal Version 8.4

Any updates on it?

handkerchief’s picture

is anyone in charge of this?

gngn’s picture

My customer wanted the translations (mainly the submit buttons).
So I ended up "hand coding" the yml files in sites/default/config/language/de/.

Using the original entity_browser.browser.XYZ.yml I came up with something like this:

display_configuration:
  link_text: 'Bild auswählen'
widgets:
  ecbda831-188b-4b30-a4ff-a8c0210a0052:
    settings:
      submit_text: 'Bild auswählen'
  647f1753-8356-4cfe-959c-bfd797b14b53:
    settings:
      submit_text: Speichern

I imported the configuration (drush cim).
Worked for me.

johnwebdev’s picture

Have the same issue though it only seems like the Overview page actually is broken:

admin/config/content/entity_browser/{entity_browser}/general/translate/{langcode}/add
admin/config/content/entity_browser/{entity_browser}/general/translate/{langcode}/edit

works as expected.

Edit:

I've been digging into the issue and they ways we can solve this either to adjust the edit_form route name to omit {step} or make an issue for config_translation to allow having more parameters.

URLs are generated in core/modules/config_translation/src/Controller/ConfigTranslationController.php

The URL route parameters are only provided with

  /**
   * {@inheritdoc}
   */
  public function getBaseRouteParameters() {
    return [$this->entityType => $this->entity->id()];
  }

And langcodes parameter if add/edit/delete-form.

The config translation module assumes: /admin/config/content/entity_browser/{entity_browser}
and Entity Browser has the following route: /admin/config/content/entity_browser/{entity_browser}/{step} defined.

which means either Entity Browser has to adjust its route, or we need to add an issue to config translation to allow for additional parameters for the edit_form route which is used as base.

I've created core issue: https://www.drupal.org/project/drupal/issues/2926761

gngn’s picture

Calling

admin/config/content/entity_browser/{entity_browser}/general/translate/{langcode}/add
admin/config/content/entity_browser/{entity_browser}/general/translate/{langcode}/edit

explicitly as johndevman suggested in #29 works - but it only gives me the most basic translations fields and not link_text or submit_text.

Saving it throws

Uncaught PHP Exception
Symfony\Component\Routing\Exception\MissingMandatoryParametersException:
"Some mandatory parameters are missing ("step") to generate a URL for route 
  "Route with pattern /admin/config/content/entity_browser/{entity_browser}/{step}/translate"."
at /core/lib/Drupal/Core/Routing/UrlGenerator.php line 182

So I am stuck to hand editing language/de/XYZ.yml and importing it as mentioned in #28.

dylan donkersgoed’s picture

StatusFileSize
new1.72 KB

Here's a patch that makes those other fields translatable. It doesn't address the route issue but works with the workaround of manually accessing the add/edit route described in #29.

socialnicheguru’s picture

Status: Active » Needs review
juandels3’s picture

For those people who want to translate urgently, you can do it by touching the configuration directly from the .yml files. Usually the configuration file is located in config/sync/entity_browser.browser.media_entity_browser.yml, being able to add translations from config/sync/language/es/entity_browser.browser.media_entity_browser.yml in case the translation is in Spanish.

berdir’s picture

Title: Symfony\Component\Routing\Exception\MissingMandatoryParametersException: Some mandatory parameters are missing ("machine_name", "step") to generate a URL for route "entity.entity_browser.config_translation_overview". » Update config schema to allow translation
Status: Needs review » Needs work
Issue tags: -Media Initiative, -D8Media, -file entity browser

The route issue should no longer be a problem, as we just removed the ctools wizard/integration, should be a regular edit route now.

Updating the issue title to reflect the latest patch that is just about using the correct schema. Setting to needs work because at least some of these should use type: label instead for a single-line textfield, type text is for multi-line texts with a textarea form element.

primsi’s picture

Status: Needs work » Needs review
StatusFileSize
new1.41 KB

All seem to be a single line text field.

mpp’s picture

@berdir #34, there were already some issues with patches to fix the schema issues. I added them to the references and closed them in favor of this issue.

Since the latest patch here also contains the code from those patches it should probably also fix the wrong use of the one of the keys:

-      '#value' => $this->t($this->configuration['select_text']),
+      '#value' => $this->configuration['select_text'],
mpp’s picture

StatusFileSize
new2.09 KB
berdir’s picture

Status: Needs review » Reviewed & tested by the community

Thanks, looks good. Removing the t() is the correct thing, but some people might be unhappy if they previously used to translate that through interface translation.

  • Primsi committed aebede7 on 8.x-2.x authored by mpp
    Issue #2675390 by mpp, Dylan Donkersgoed, Primsi, Berdir: Update config...
primsi’s picture

Status: Reviewed & tested by the community » Fixed

Thanks.

oknate’s picture

This needs to be added to 8.x-1.x branch, right?

berdir’s picture

Status: Fixed » Reviewed & tested by the community

Yeah.

  • Primsi committed 7aa8042 on 8.x-1.x authored by mpp
    Issue #2675390 by mpp, Dylan Donkersgoed, Primsi, Berdir: Update config...
primsi’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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