Closed kunicmarko20 closed 6 years ago
@mohamedyasser can you check if this fixes your problem?
it's work but after enable bundle and use Annotation in entity and clear cache not generate a admin
Hm, can you provide me the code of your enitity so I can reproduce it?
use Doctrine\ORM\Mapping as ORM;
use MediaBundle\Entity\Media;
use KunicMarko\SonataAnnotationBundle\Annotation as Sonata;
/**
* Service
*
* @Sonata\Admin("Service")
*
* @ORM\Table(name="services")
* @ORM\HasLifecycleCallbacks
* @ORM\Entity()
*/
class Service
{
/**
* @var int
*
* @Sonata\ListField()
*
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string
*
* @Sonata\FormField()
* @Sonata\ListField()
*
* @ORM\Column(name="name", type="string", length=100)
*/
private $name;
/**
* @return int
*/
public function getId(): ?int
{
return $this->id;
}
/**
* @return string
*/
public function getName(): ?string
{
return $this->name;
}
/**
* @param string $name
*/
public function setName(string $name): void
{
$this->name = $name;
}
}
I tested and it works, not sure what problems you have, any kind of error?
repo: https://github.com/kunicmarko20/annotation-test-issue-10 entity: https://github.com/kunicmarko20/annotation-test-issue-10/blob/master/src/Entity/Service.php tests: https://github.com/kunicmarko20/annotation-test-issue-10/blob/master/tests/AdminExistTest.php travis build: https://travis-ci.org/kunicmarko20/annotation-test-issue-10/builds/363725432
are you tested in SY3 this issue on SY3 i'm tested in SY4 and work fine? there is no error in log
Check repo, I tested on sf3.4 + flex, did you try with or without flex?
I think i found error, check this line:
If you are on flex kernel is in src
folder but if you are not using flex it is in app
so that could be a problem.
without flex
I am targeting this branch because this is a BC fix.
Closes #10
Changelog
Subject
There is no check if namespace line is not found and then if we try to use preg_match it throws an exception.