fixed some issues caused by c&ping from opencase_entities

This commit is contained in:
2021-02-18 12:02:25 +00:00
parent 0f0281c58c
commit bc98ecb541
27 changed files with 89 additions and 90 deletions

View File

@ -1,13 +1,13 @@
<?php
namespace Drupal\opencase_entities\Form;
namespace Drupal\opencase_cases\Form;
use Drupal\Core\Entity\ContentEntityDeleteForm;
/**
* Provides a form for deleting Case entities.
*
* @ingroup opencase_entities
* @ingroup opencase_cases
*/
class OCCaseDeleteForm extends ContentEntityDeleteForm {

View File

@ -1,6 +1,6 @@
<?php
namespace Drupal\opencase_entities\Form;
namespace Drupal\opencase_cases\Form;
use Drupal\Core\Entity\ContentEntityForm;
use Drupal\Core\Form\FormStateInterface;
@ -8,7 +8,7 @@ use Drupal\Core\Form\FormStateInterface;
/**
* Form controller for Case edit forms.
*
* @ingroup opencase_entities
* @ingroup opencase_cases
*/
class OCCaseForm extends ContentEntityForm {
@ -16,7 +16,7 @@ class OCCaseForm extends ContentEntityForm {
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state) {
/* @var $entity \Drupal\opencase_entities\Entity\OCCase */
/* @var $entity \Drupal\opencase_cases\Entity\OCCase */
$form = parent::buildForm($form, $form_state);
if (!$this->entity->isNew()) {

View File

@ -1,6 +1,6 @@
<?php
namespace Drupal\opencase_entities\Form;
namespace Drupal\opencase_cases\Form;
use Drupal\Core\Database\Connection;
use Drupal\Core\Entity\EntityStorageInterface;
@ -12,7 +12,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Provides a form for deleting a Case revision.
*
* @ingroup opencase_entities
* @ingroup opencase_cases
*/
class OCCaseRevisionDeleteForm extends ConfirmFormBase {
@ -20,7 +20,7 @@ class OCCaseRevisionDeleteForm extends ConfirmFormBase {
/**
* The Case revision.
*
* @var \Drupal\opencase_entities\Entity\OCCaseInterface
* @var \Drupal\opencase_cases\Entity\OCCaseInterface
*/
protected $revision;

View File

@ -1,19 +1,19 @@
<?php
namespace Drupal\opencase_entities\Form;
namespace Drupal\opencase_cases\Form;
use Drupal\Core\Datetime\DateFormatterInterface;
use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\Core\Form\ConfirmFormBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Url;
use Drupal\opencase_entities\Entity\OCCaseInterface;
use Drupal\opencase_cases\Entity\OCCaseInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Provides a form for reverting a Case revision.
*
* @ingroup opencase_entities
* @ingroup opencase_cases
*/
class OCCaseRevisionRevertForm extends ConfirmFormBase {
@ -21,7 +21,7 @@ class OCCaseRevisionRevertForm extends ConfirmFormBase {
/**
* The Case revision.
*
* @var \Drupal\opencase_entities\Entity\OCCaseInterface
* @var \Drupal\opencase_cases\Entity\OCCaseInterface
*/
protected $revision;
@ -130,12 +130,12 @@ class OCCaseRevisionRevertForm extends ConfirmFormBase {
/**
* Prepares a revision to be reverted.
*
* @param \Drupal\opencase_entities\Entity\OCCaseInterface $revision
* @param \Drupal\opencase_cases\Entity\OCCaseInterface $revision
* The revision to be reverted.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current state of the form.
*
* @return \Drupal\opencase_entities\Entity\OCCaseInterface
* @return \Drupal\opencase_cases\Entity\OCCaseInterface
* The prepared revision ready to be stored.
*/
protected function prepareRevertedRevision(OCCaseInterface $revision, FormStateInterface $form_state) {

View File

@ -1,18 +1,18 @@
<?php
namespace Drupal\opencase_entities\Form;
namespace Drupal\opencase_cases\Form;
use Drupal\Core\Datetime\DateFormatterInterface;
use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Language\LanguageManagerInterface;
use Drupal\opencase_entities\Entity\OCCaseInterface;
use Drupal\opencase_cases\Entity\OCCaseInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Provides a form for reverting a Case revision for a single translation.
*
* @ingroup opencase_entities
* @ingroup opencase_cases
*/
class OCCaseRevisionRevertTranslationForm extends OCCaseRevisionRevertForm {
@ -93,7 +93,7 @@ class OCCaseRevisionRevertTranslationForm extends OCCaseRevisionRevertForm {
protected function prepareRevertedRevision(OCCaseInterface $revision, FormStateInterface $form_state) {
$revert_untranslated_fields = $form_state->getValue('revert_untranslated_fields');
/** @var \Drupal\opencase_entities\Entity\OCCaseInterface $default_revision */
/** @var \Drupal\opencase_cases\Entity\OCCaseInterface $default_revision */
$latest_revision = $this->OCCaseStorage->load($revision->id());
$latest_revision_translation = $latest_revision->getTranslation($this->langcode);

View File

@ -1,6 +1,6 @@
<?php
namespace Drupal\opencase_entities\Form;
namespace Drupal\opencase_cases\Form;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
@ -8,7 +8,7 @@ use Drupal\Core\Form\FormStateInterface;
/**
* Class OCCaseSettingsForm.
*
* @ingroup opencase_entities
* @ingroup opencase_cases
*/
class OCCaseSettingsForm extends FormBase {

View File

@ -1,6 +1,6 @@
<?php
namespace Drupal\opencase_entities\Form;
namespace Drupal\opencase_cases\Form;
use Drupal\Core\Entity\EntityConfirmFormBase;
use Drupal\Core\Form\FormStateInterface;

View File

@ -1,6 +1,6 @@
<?php
namespace Drupal\opencase_entities\Form;
namespace Drupal\opencase_cases\Form;
use Drupal\Core\Entity\EntityForm;
use Drupal\Core\Form\FormStateInterface;
@ -30,7 +30,7 @@ class OCCaseTypeForm extends EntityForm {
'#type' => 'machine_name',
'#default_value' => $oc_case_type->id(),
'#machine_name' => [
'exists' => '\Drupal\opencase_entities\Entity\OCCaseType::load',
'exists' => '\Drupal\opencase_cases\Entity\OCCaseType::load',
],
'#disabled' => !$oc_case_type->isNew(),
];