removed all person stuff and rand update entiees

This commit is contained in:
naomi
2018-04-11 10:44:29 +02:00
parent c47ce313b3
commit add15f2c6d
15 changed files with 117 additions and 973 deletions

View File

@ -19,15 +19,6 @@ class PersonForm extends ContentEntityForm {
/* @var $entity \Drupal\zencrm_entities\Entity\Person */
$form = parent::buildForm($form, $form_state);
if (!$this->entity->isNew()) {
$form['new_revision'] = [
'#type' => 'checkbox',
'#title' => $this->t('Create new revision'),
'#default_value' => FALSE,
'#weight' => 10,
];
}
$entity = $this->entity;
return $form;
@ -39,18 +30,6 @@ class PersonForm extends ContentEntityForm {
public function save(array $form, FormStateInterface $form_state) {
$entity = $this->entity;
// Save as a new revision if requested to do so.
if (!$form_state->isValueEmpty('new_revision') && $form_state->getValue('new_revision') != FALSE) {
$entity->setNewRevision();
// If a new revision is created, save the current user as revision author.
$entity->setRevisionCreationTime(REQUEST_TIME);
$entity->setRevisionUserId(\Drupal::currentUser()->id());
}
else {
$entity->setNewRevision(FALSE);
}
$status = parent::save($form, $form_state);
switch ($status) {