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

How can I use Gedmo Translatable and Gedmo Loggable together? #479

Open
creator81 opened this issue Feb 29, 2024 · 3 comments
Open

How can I use Gedmo Translatable and Gedmo Loggable together? #479

creator81 opened this issue Feb 29, 2024 · 3 comments

Comments

@creator81
Copy link

creator81 commented Feb 29, 2024

I use Smyfony 6.4 with Doctrine and stof/doctrine-extensions-bundle

<?php

namespace App\Entity;

use App\Repository\TestRepository;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Loggable\Loggable;
use Gedmo\Translatable\Translatable;
use Gedmo\Mapping\Annotation as Gedmo;

#[Gedmo\Loggable]
#[ORM\Entity(repositoryClass: TestRepository::class)]
class Test implements Translatable, Loggable
{
    #[ORM\Id]
    #[ORM\GeneratedValue]
    #[ORM\Column]
    private ?int $id = null;

    #[Gedmo\Versioned]
    #[Gedmo\Translatable]
    #[ORM\Column(length: 255)]
    private ?string $name = null;
    
}

Versioning does not take place once Translatable is activated. The instruction is simply ignored.
There are no log entries that indicate an error.

If I use Gedmo\Versioned, it works.
If I use Gedmo\Translatable, it works.
If I use both, only Gedmo\Translatable works.

Is that what you want?

I also posted the question here
https://stackoverflow.com/questions/77988068/how-can-i-use-gedmo-translatable-and-gedmo-loggable-together

@Chris53897
Copy link

@creator81
Copy link
Author

This is from 2018, so I ignored that. Sorry!
I don't want a priority for this, but rather need both functionalities on the same property.

I suspect that it is not intended to use both functions on one property?

The logic is similar, but as I understand it is not feasible because the translations would then have to refer to the table with the versions.

@stof
Copy link
Owner

stof commented Aug 30, 2024

You should ask on the repository of the extensions themselves to know whether both extensions can be used on the same field or no.
This repository is for the Symfony bundle providing the wiring of the extensions, not for the extensions themselves (and I'm not the maintainer of the extensions)

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

No branches or pull requests

3 participants