This topic contains 1 reply, has 2 voices, and was last updated by ignat 8 years, 3 months ago.
- Topic
Hi team!
I’m developing application based on Oro BAP and I’ve faced the issue with making my entity dataaudible after installing Oro.
The setup is as follows:
I have an entity called Ticket and it has a property called Status.
They are both configured to be dataaudible via Config/ConfigField annotations, as described by Oro docs.
The field Status is of custom Doctrine type, also called Status. This custom DBAL type is correctly registered in Doctrine. Status type extends String DBAL type.I’ve registered custom DataAudit Field Type in my bundle class like this:
AuditFieldTypeRegistry::addType('status', 'status');
and ‘ve created the migration to extend oro_audit_field table with column status, which should hold the value of ticket status upon change.123$this->auditFieldExtension->addType($schema, 'status', 'status');I’ve ran the migration, so I can find my newly added column in the oro_audit_field columns and also I see the old_status and new_status columns in oro_entity_config_field table for AuditField entity.
I assume, that installation went correctly.
Now the tricky part is that if I install my application within installation of Oro Platform – everything works fine. I can create Tickets and see the changes in Data Audit grid.
But if I install OroCRM and then try to install my application alongside with CRM, it breaks. When I attempt to create ticket, I get following error
123Exception occurred: Neither property "oldStatus" nor "old_status" was found. Maybe you forget to add migration?Note, that I see all the columns and entity field configs in the database.
I did some digging and debugging, resulting in following:
Oro BAP simultaneous installation: in app/cache/%env%/oro_entities/Extend/Entity I have two files
EX_OroDataAuditBundle_AuditField.orm.yml with following content:12345678910111213141516171819Extend\Entity\EX_OroDataAuditBundle_AuditField:type: mappedSuperclassfields:old_status:column: old_statustype: statusnullable: truelength: nullprecision: nullscale: nullnew_status:column: new_statustype: statusnullable: truelength: nullprecision: nullscale: nulland EX_OroDataAuditBundle_AuditField.php with following code:
1234567891011121314151617181920212223<?phpnamespace Extend\Entity;abstract class EX_OroDataAuditBundle_AuditField extends \Oro\Bundle\DataAuditBundle\Entity\AbstractAuditField implements \Oro\Bundle\EntityExtendBundle\Entity\ExtendEntityInterface{protected $old_status;protected $new_status;public function setOldStatus($value){$this->old_status = $value; return $this;}...public function setNewStatus($value){$this->new_status = $value; return $this;}//__construct goes hereInstalling app after OroCRM was completely installed: I have same two files but
EX_OroDataAuditBundle_AuditField.orm.yml is empty12345Extend\Entity\EX_OroDataAuditBundle_AuditField:type: mappedSuperclassfields: { }and EX_OroDataAuditBundle_AuditField.php also contains only call to a parent::__construct() method.
And advice on what I’m doing wrong?
The forum ‘OroPlatform – Programming Questions’ is closed to new topics and replies.