Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include TranslationRevertRoute only when content entity is translatable #2932

Merged
merged 1 commit into from
Nov 24, 2016

Conversation

plopesc
Copy link
Contributor

@plopesc plopesc commented Nov 13, 2016

getRevisionTranslationRevertRoute() method is included only in content entities when the revisionable entity is marked as translatable.
However, the method is called always when the entity type is marked as revisionable.
This throws the error below:

Call to undefined method Drupal\ef_system\CompanyHtmlRouteProvider::getRevisionTranslationRevertRoute() in /var/www/drupalvm/web/modules/custom/ef_system/src/CompanyHtmlRouteProvider.php on line 45 #0 /var/www/drupalvm/web/core/lib/Drupal/Core/EventSubscriber/EntityRouteProviderSubscriber.php(47): Drupal\ef_system\CompanyHtmlRouteProvider->getRoutes(Object(Drupal\Core\Entity\ContentEntityType))

That's why I'm proposing here to add an extra check and call that method and create the route only when the entity type is revisonable AND translatable.

Thanks for your efforts

@kgaut
Copy link
Contributor

kgaut commented Nov 15, 2016

Just faced this issue, I can confirm that this patch would work as I only had to remove the following lines to get rid of theses errors :

    if ($translation_route = $this->getRevisionTranslationRevertRoute($entity_type)) {
      $collection->add("{$entity_type_id}.revision_revert_translation_confirm", $translation_route);
    }

@jmolivas jmolivas merged commit d0335e8 into hechoendrupal:master Nov 24, 2016
@jmolivas
Copy link
Member

@plopesc Thanks for your contribution, your PR was merged. This will be included on the next release.

@jmolivas jmolivas added this to the 1.0.0-rc10 milestone Nov 24, 2016
bpresles pushed a commit to bpresles/DrupalConsole that referenced this pull request Dec 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants