I'm trying to set up translations using Gedmo, but the ordered behavior that I included earlier seems to be interfering:
An exception was thrown during template rendering ('The class' Sonata \ TranslationBundle \ Model \ AbstractTranslatable' was not found in the name chain Gedmo \ Translatable \ Entity, Gedmo \ Translator \ Entity, Gedmo \ Loggable \ Entity, Gedmo \ Tree \ Entity , AppBundle \ Entity, Vich \ UploaderBundle \ Entity, Sonata \ MediaBundle \ Entity, Application \ Sonata \ MediaBundle \ Entity, Sonata \ UserBundle \ Entity, Application \ Sonata \ UserBundle \ Entity, Sonata \ NewsBundle \ Entity, Sonata \ ClassificationBundle \ Entity , Application \ sonata \ NewsBundle \ Entity, Application \ sonata \ ClassificationBundle \ Entity, FOS \ UserBundle \ Model ").
The template that throws this exception is configured to handle sortable buttons:
/Pix/SortableBehaviorBundle/Resources/views/Default/_sort.html.twig (line 3)
It does not work on line 3, where it tries to set last_position (object)
{% if admin.isGranted('EDIT', object) and admin.hasRoute('edit') %}
{% set current_position = currentObjectPosition(object) %}
{% set last_position = lastPosition(object) %}
{% set enable_top_bottom_buttons = field_description.options.actions.move.enable_top_bottom_buttons ?? true %}
{% if enable_top_bottom_buttons and current_position < last_position %}
<a class="btn btn-sm btn-default" href="{{ admin.generateObjectUrl('move', object, {'position': 'bottom'}) }}" title="{{ 'move_to_bottom'|trans }}">
<i class="fa fa-angle-double-down"></i>
I follow this translation guide:
https://sonata-project.org/bundles/translation/master/doc/reference/orm.html
ORM Domains:
orm:
auto_generate_proxy_classes: '%kernel.debug%'
entity_managers:
default:
naming_strategy: doctrine.orm.naming_strategy.underscore
auto_mapping: true
mappings:
gedmo_translatable:
type: annotation
prefix: Gedmo\Translatable\Entity
dir: "%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/Gedmo/Translatable/Entity"
alias: GedmoTranslatable
is_bundle: false
gedmo_translator:
type: annotation
prefix: Gedmo\Translator\Entity
dir: "%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/Gedmo/Translator/Entity"
alias: GedmoTranslator
is_bundle: false
gedmo_loggable:
type: annotation
prefix: Gedmo\Loggable\Entity
dir: "%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/Gedmo/Loggable/Entity"
alias: GedmoLoggable
is_bundle: false
gedmo_tree:
type: annotation
prefix: Gedmo\Tree\Entity
dir: "%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/Gedmo/Tree/Entity"
alias: GedmoTree
is_bundle: false
Dump Doctrine: Comparison: Information
Found 36 mapped entities:
[OK] Gedmo\Translatable\Entity\MappedSuperclass\AbstractTranslation
[OK] Gedmo\Translatable\Entity\Translation
[OK] Gedmo\Translatable\Entity\MappedSuperclass\AbstractPersonalTranslation
[OK] Gedmo\Translator\Entity\Translation
[OK] Gedmo\Loggable\Entity\MappedSuperclass\AbstractLogEntry
[OK] Gedmo\Loggable\Entity\LogEntry
[OK] Gedmo\Tree\Entity\MappedSuperclass\AbstractClosure
[OK] AppBundle\Entity\TeamBio
[OK] AppBundle\Entity\User
[OK] AppBundle\Entity\NewsItemSource
[OK] AppBundle\Entity\NewsItem
[OK] AppBundle\Entity\NewsItemTranslation
[OK] Sonata\MediaBundle\Entity\BaseMedia
[OK] Sonata\MediaBundle\Entity\BaseGallery
[OK] Sonata\MediaBundle\Entity\BaseGalleryHasMedia
[OK] Application\Sonata\MediaBundle\Entity\GalleryHasMedia
[OK] Application\Sonata\MediaBundle\Entity\Gallery
[OK] Application\Sonata\MediaBundle\Entity\Media
[OK] Sonata\UserBundle\Entity\BaseUser
[OK] Sonata\UserBundle\Entity\BaseGroup
[OK] Application\Sonata\UserBundle\Entity\Group
[OK] Application\Sonata\UserBundle\Entity\User
[OK] Sonata\NewsBundle\Entity\BaseComment
[OK] Sonata\NewsBundle\Entity\BasePost
[OK] Sonata\ClassificationBundle\Entity\BaseTag
[OK] Sonata\ClassificationBundle\Entity\BaseCollection
[OK] Sonata\ClassificationBundle\Entity\BaseCategory
[OK] Sonata\ClassificationBundle\Entity\BaseContext
[OK] Application\Sonata\NewsBundle\Entity\Comment
[OK] Application\Sonata\NewsBundle\Entity\Post
[OK] Application\Sonata\ClassificationBundle\Entity\Collection
[OK] Application\Sonata\ClassificationBundle\Entity\Category
[OK] Application\Sonata\ClassificationBundle\Entity\Tag
[OK] Application\Sonata\ClassificationBundle\Entity\Context
[OK] FOS\UserBundle\Model\Group
[OK] FOS\UserBundle\Model\User