This topic contains 2 replies, has 3 voices, and was last updated by adriwan_kenoby 7 years, 4 months ago.
- Topic
Hi,
I have been getting this error repeatedly throughout my entire oro “carrer”. It says:
An exception has been thrown during the rendering of a template (“[Semantical Error] line 0, col 85 near ‘coordinates,’: Error: Invalid PathExpression. Must be a StateFieldPathExpression.”) in C:\xampp\htdocs\orocrm_072814\crm-application\vendor\oro\platform\src\Oro\Bundle\UIBundle/Resources/views/actions/index.html.twig at line 30.Now, I am aware that the most likely cause of this is there is an error somewhere in the logic (in my case the annotations) that define my applications entity configuration. Sometimes, I am able to identify where I messed up and the error stops. Lately however, the error keeps re-occurring and I’m positive there’s not a problem with my code (I posted it below to make sure).
I’ve tried clear every type of cache that exists in oro as well as manually deleted the cache folders.. Am I missing something?
Also I’m now getting this error out of nowhere:
Warning: Cannot redeclare class in C:\xampp\htdocs\orocrm_072814\crm-application\vendor\oro\platform\src\Oro\Bundle\EntityExtendBundle\Tools\ExtendClassLoadingUtils.php on line 71EX: I have a bundle called StcGoogleMapBundle and it has two entities, GoogleMap and Coordinate. The map can have a collection of coordinates (many to one, unidirectional). Here is my code:
GoogleMap:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315namespace Stc\Bundle\GoogleMapBundle\Entity;use Doctrine\ORM\Mapping as ORM;use Doctrine\Common\Collections\Collection;use Doctrine\Common\Collections\ArrayCollection;use JMS\Serializer\Annotation as JMS;use OroCRM\Bundle\ContactBundle\Entity\Contact;use Oro\Bundle\EntityConfigBundle\Metadata\Annotation\Config;use Oro\Bundle\EntityConfigBundle\Metadata\Annotation\ConfigField;use Oro\Bundle\DataAuditBundle\Metadata\Annotation as Oro;use Oro\Bundle\UserBundle\Entity\User;use Symfony\Component\Security\Core\User\AdvancedUserInterface;use Symfony\Component\Validator\Constraints\NotIdenticalTo;use Stc\Bundle\GoogleMapBundle\Model\ExtendGoogleMap;use Stc\Bundle\GoogleMapBundle\Entity\Coordinate;/*** GoogleMap** @ORM\Table(name="stc_googlemap", indexes={* @ORM\Index(name="stc_googlemap_name_idx", columns={"name"})* })* @ORM\HasLifecycleCallbacks()* @Oro\Loggable* @ORM\Entity(repositoryClass="Stc\Bundle\GoogleMapBundle\Entity\Repository\GoogleMapRepository")* @Config(* defaultValues={* "ownership"={* "owner_type"="USER",* "owner_field_name"="owner",* "owner_column_name"="owner_id"* },* "security"={* "type"="ACL"* },* "dataaudit"={"auditable"=true}* }* )*/class GoogleMap extends ExtendGoogleMap{/*** @var integer** @ORM\Column(type="integer")* @ORM\Id* @ORM\GeneratedValue(strategy="AUTO")* @JMS\Type("integer")*/protected $id;/*** @var string** @ORM\Column(name="name", type="string", length=255)* @Oro\Versioned* @JMS\Type("string")* @ConfigField(* defaultValues={* "dataaudit"={"auditable"=true},* "email"={"available_in_template"=true}* }* )*/protected $name;/*** @var \DateTime $created** @ORM\Column(type="datetime")* @JMS\Type("DateTime")* @ConfigField(* defaultValues={* "email"={"available_in_template"=true}* }* )*/protected $createdAt;/*** @var \DateTime $updated** @ORM\Column(type="datetime", nullable=true)* @JMS\Type("DateTime")* @ConfigField(* defaultValues={* "email"={"available_in_template"=true}* }* )*/protected $updatedAt;/*** @var User** @ORM\ManyToOne(targetEntity="Oro\Bundle\UserBundle\Entity\User")* @ORM\JoinColumn(name="owner_id", referencedColumnName="id", onDelete="SET NULL")* @Oro\Versioned("getUsername")* @JMS\Type("integer")* @JMS\Accessor(getter="getOwnerId")* @ConfigField(* defaultValues={* "dataaudit"={"auditable"=true},* "email"={"available_in_template"=true}* }* )*/protected $owner;/*** @var string** @ORM\Column(name="mapType", type="string", nullable=true)* @Oro\Versioned* @ConfigField(* defaultValues={* "dataaudit"={"auditable"=true},* "email"={"available_in_template"=true}* }* )+* @JMS\Type("string")*/protected $mapType;/*** @var boolean** @ORM\Column(type="boolean")* @JMS\Type("boolean")*/protected $deleted;/*** @ORM\ManyToMany(targetEntity="Stc\Bundle\GoogleMapBundle\Entity\GoogleMap")* @ORM\JoinTable(* name="stc_googlemap_to_coordinates",* joinColumns={@ORM\JoinColumn(name="googlemap_id", referencedColumnName="id")},* inverseJoinColumns={@ORM\JoinColumn(name="coordinate_id", referencedColumnName="id")}* )*/private $coordinates;/*** Constructor*/public function __construct(){$this->coordinates = new ArrayCollection();}/* GETTERS *//*** @return \DateTime*/public function getCreatedAt(){return $this->createdAt;}/*** @return boolean*/public function getDeleted(){return $this->deleted;}/*** @return int*/public function getId(){return $this->id;}/*** @return string*/public function getName(){return $this->name;}/*** @return \Oro\Bundle\UserBundle\Entity\User*/public function getOwner(){return $this->owner;}/*** @return string*/public function getOwnership(){return $this->ownership;}/*** @return \DateTime*/public function getUpdatedAt(){return $this->updatedAt;}/*** Add coordinate** @param Contact $contacts* @return GoogleMap*/public function addCoordinate(Coordinate $coordinate){$this->coordinates[] = $coordinate;return $this;}/*** Remove coordinate** @param Coordinate $coordinate*/public function removeContact(Coordinate $coordinate){$this->coordinate->removeElement($coordinate);}/*** Get coordinates** @return \Doctrine\Common\Collections\Collection*/public function getCoordinate(){return $this->coordinate;}/* SETTERS *//*** @param \DateTime $createdAt*/public function setCreatedAt($createdAt){$this->createdAt = $createdAt;}/*** @param boolean $deleted*/public function setDeleted($deleted){$this->deleted = $deleted;}/*** @param string $name*/public function setName($name){$this->name = $name;}/*** @param \Oro\Bundle\UserBundle\Entity\User $owner*/public function setOwner($owner){$this->owner = $owner;}/*** @param string $ownership*/public function setOwnership($ownership){$this->ownership = $ownership;}/*** @param \DateTime $updatedAt*/public function setUpdatedAt($updatedAt){$this->updatedAt = $updatedAt;}/*** @return string*/public function getOwnerId(){$owner = $this->getOwner();if (is_object($owner)) {return $owner->getId();}}}Coordinate:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240namespace Stc\Bundle\GoogleMapBundle\Entity;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\ORM\Mapping as ORM;use Doctrine\Common\Collections\Collection;use JMS\Serializer\Annotation as JMS;use Oro\Bundle\EntityConfigBundle\Metadata\Annotation\Config;use Oro\Bundle\EntityConfigBundle\Metadata\Annotation\ConfigField;use Oro\Bundle\TagBundle\Entity\Taggable;use Oro\Bundle\DataAuditBundle\Metadata\Annotation as Oro;use Oro\Bundle\UserBundle\Entity\User;use Symfony\Component\Security\Core\User\AdvancedUserInterface;use Symfony\Component\Validator\Constraints\NotIdenticalTo;use Stc\Bundle\PerformanceBundle\Entity\Performance;use Stc\Bundle\GoogleMapBundle\Model\ExtendCoordinate;use Ivory\GoogleMapBundle\Entity\Coordinate as GMapsCoordinate;/*** Coordinate** @ORM\Table(name="stc_coordinate", indexes={@ORM\Index(name="stc_googlemap_name_idx", columns={"name"})})** @Oro\Loggable* @ORM\Entity(repositoryClass="Stc\Bundle\GoogleMapBundle\Entity\Repository\CoordinateRepository")* @Config(* defaultValues={* "ownership"={* "owner_type"="USER",* "owner_field_name"="owner",* "owner_column_name"="owner_id"* },* "security"={* "type"="ACL"* },* "dataaudit"={"auditable"=true}* }* )*/class Coordinate extends ExtendCoordinate implements Taggable{/*** @var integer** @ORM\Column(type="integer")* @ORM\Id* @ORM\GeneratedValue(strategy="AUTO")* @JMS\Type("integer")*/protected $id;/*** @ORM\Column(type="text")**/protected $address;/*** @var string** @ORM\Column(type="string", length=255, nullable=true, name="name")* @Oro\Versioned* @JMS\Type("string")* @ConfigField(* defaultValues={* "dataaudit"={"auditable"=true},* "email"={"available_in_template"=true}* }* )*/protected $name;/*** @var float** @ORM\Column(type="float")* @JMS\Type("double")*/private $latitude;/*** @var float** @ORM\Column(type="float")* @JMS\Type("double")*/private $longitude;/*** @var string** @ORM\Column(type="string")* @JMS\Type("string")*/private $entityType;/*** @var integer** @ORM\Column(type="integer")* @JMS\Type("integer")*/private $entityId;public function __construct($lat = null, $lng = null){$this->latitude = $lat;$this->longitude = $lng;}public function getLatitude(){return $this->latitude;}public function getLongitude(){return $this->longitude;}public function setLatitude($lat){$this->latitude = $lat;}public function setLongitude($lng){$this->longitude = $lng;}public function __toString(){return '(' . $this->latitude . ', ' . $this->longitude . ')';}public function createFromString($string){if (strlen($string) < 1) {return new self;}$string = str_replace(['(', ')', ' '], '', $string);$data = explode(',', $string);if ($data[0] === "" || $data[1] === "") {return new self;}return new self($data[0], $data[1]);}public function toGmaps(){return new GMapsCoordinate($this->latitude, $this->longitude);}/** @return ArrayCollection*/public function getTags(){if (null === $this->tags) {$this->tags = new ArrayCollection();}return $this->tags;}/** @param $tags* @return Performance*/public function setTags($tags){$this->tags = $tags;return $this;}/*** @return int*/public function getTaggableId(){return $this->getId();}/*** @param string $name*/public function setName($name){$this->name = $name;}/*** @return string*/public function getName(){return $this->name;}/*** @param mixed $entityType*/public function setEntityType($entityType){$this->entityType = $entityType;}/*** @return mixed*/public function getEntityType(){return $this->entityType;}/*** @param mixed $entityId*/public function setEntityId($entityId){$this->entityId = $entityId;}/*** @return mixed*/public function getEntityId(){return $this->entityId;}}Thank you in advance, sorry its a long post.
~Coding my life away~
The forum ‘OroPlatform – Installation/Technical Issues or Problems’ is closed to new topics and replies.