File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
modules/apigee_edge_teams/src/Entity/Form Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 3737 */
3838class TeamForm extends FieldableEdgeEntityForm implements EdgeEntityFormInterface {
3939
40+ /**
41+ * Admin email attribute name.
42+ */
43+ const ADMIN_EMAIL_ATTRIBUTE = 'ADMIN_EMAIL ' ;
44+
4045 /**
4146 * The team membership manager service.
4247 *
@@ -89,6 +94,21 @@ public static function create(ContainerInterface $container) {
8994 );
9095 }
9196
97+ /**
98+ * {@inheritdoc}
99+ */
100+ public function buildEntity (array $ form , FormStateInterface $ form_state ) {
101+ /** @var \Drupal\apigee_edge_teams\Entity\TeamInterface $team */
102+ $ team = parent ::buildEntity ($ form , $ form_state );
103+
104+ // ADMIN_EMAIL_ATTRIBUTE is a required field for monetization.
105+ // We add to any team to make sure team creation works for mint orgs even
106+ // if they do not enable the m10n teams module.
107+ $ team ->setAttribute (static ::ADMIN_EMAIL_ATTRIBUTE , $ this ->currentUser ->getEmail ());
108+
109+ return $ team ;
110+ }
111+
92112 /**
93113 * {@inheritdoc}
94114 */
You can’t perform that action at this time.
0 commit comments