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
fix missing locale annotation for Gedmo trait #121
Conversation
* | ||
* @author Nicolas Bastien <nbastien.pro@gmail.com> | ||
*/ | ||
trait Translatable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please follow symfony code style and rename it to TranslateableTrait
@nicolas-bastien can you please verify this PR? |
@soullivaneuh stuck StyleCi build |
* | ||
* @author Gediminas Morkevicius <gediminas.morkevicius@gmail.com> | ||
* | ||
* @link http://www.gediminasm.org |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be removed
@dmarkowicz why do we need this file? |
'memory' => true, | ||
); | ||
|
||
$config = null === $config ? $this->getMockAnnotatedConfig() : $config; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about $config ?: $this->getMockAnnotatedConfig()
Thanks for comments. |
@@ -12,7 +12,6 @@ | |||
namespace Sonata\TranslationBundle\Traits\Gedmo; | |||
|
|||
use Sonata\TranslationBundle\Model\Gedmo\AbstractPersonalTranslation; | |||
use Sonata\TranslationBundle\Traits\Gedmo\Translatable; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fixup this commit with the previous commit.
I squashed PR. @OskarStark temp folder is not needed anymore, updated according to @greg0ire comments. |
@@ -21,7 +20,7 @@ | |||
*/ | |||
trait PersonalTranslatable | |||
{ | |||
use Translatable; | |||
use TranslatableTrait; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should merge #124 first, who does the name refactoring @OskarStark
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok then feel free to merge #124 and ping @dmarkowicz when he should rebase on this
thank you @core23 👍
Could you please rebase your PR and fix merge conflicts? |
Done! |
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected function setUp() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this empty method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
use Doctrine\ORM\Mapping\Driver\AnnotationDriver; | ||
use Doctrine\ORM\Tools\SchemaTool; | ||
|
||
abstract class DoctrineOrmTestCase extends \PHPUnit_Framework_TestCase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add some phpDoc including a description and author.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Is there anything else I can improve here? |
@core23 can you please give us a final review? thank you! |
{ | ||
$evm = new EventManager(); | ||
|
||
return $evm; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OTV
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does OTV mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One time variable ;)
You assigned a variable and used it only once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks :)
RTM, after fixing the last comments |
I pushed the last changes. |
Thanks @dmarkowicz ! |
I am targetting this branch, because it is a bug fix for 2.x
Changelog
Subject
\Traits\Gedmo\PersonalTranslatableTrait
should use new\Traits\Gedmo\TranslatableTrait
with@Gedmo\Locale
annotation (same as\Model\Gedmo\AbstractTranslatable
class). This fix$entity->setLocale('XX')
mechanic if entity use traits.