v8.5.12
Exception Occurred: /home/fcwork/public_html/concrete/vendor/doctrine/orm/lib/Doctrine/ORM/ORMException.php:87 Entity of type Concrete\Core\Entity\Attribute\Value\ExpressValue is missing an assigned ID for field ‘attribute_key’. The identifier generation strategy for this entity requires the ID field to be populated before EntityManager#persist() is called. If you want automatically generated identifiers instead you need to adjust the metadata mapping accordingly. (0)
I receive this error on the $jgEntry->save() of Express::buildEntry(‘journey_grp’);
I even created a new parrallel Express dataobject for testing since I started using Express back in the early v8 versions. That did not fix the problem. Trying this was based on the following references.
Here is my code which I have been running and testing the just created v8.5.12 journey_grp dataobject and on the old original journey_group dataobject. I have created other similar dataobject entries successfully which have User Select fields and Associations.
$jgEntry = \Express::buildEntry('journey_grp');
if ($jgEntry) {
$jgEntry->setAttibute('journey_grp_member_id',$userId); // User Select
$jgEntry->setAttibute('journey_grp_member_name',$userNameOrig);
$jgEntry->setAttibute('journey_grp_name',$groupName);
$jgEntry->setAttibute('journey_grp_number',99);
$jgEntry->setAttibute('journey_grp_short_desc','');
$jgEntry->setAttibute('journey_grp_long_desc','');
$jgEntry->setAttibute('journey_grp_leader_info','');
if ($isLeader) {
$jgEntry->setAttibute('journey_grp_is_leader',1);
} else {
$jgEntry->setAttibute('journey_grp_is_leader',0);
}
$jgResult = $jgEntry->save();
if ($jgResult) {
// --- Add Associations ---
$jgResult->associateEntries()->setLabelHub($labelHub);
$jgResult->associateEntries()->setLeaderOne($leaderOne);
}
return true;
}