File tree 1 file changed +20
-0
lines changed
modules/apigee_edge_teams/src/Entity/Form
1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 37
37
*/
38
38
class TeamForm extends FieldableEdgeEntityForm implements EdgeEntityFormInterface {
39
39
40
+ /**
41
+ * Admin email attribute name.
42
+ */
43
+ const ADMIN_EMAIL_ATTRIBUTE = 'ADMIN_EMAIL ' ;
44
+
40
45
/**
41
46
* The team membership manager service.
42
47
*
@@ -89,6 +94,21 @@ public static function create(ContainerInterface $container) {
89
94
);
90
95
}
91
96
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
+
92
112
/**
93
113
* {@inheritdoc}
94
114
*/
You can’t perform that action at this time.
0 commit comments