Commit 093ea794 authored by alexpott's avatar alexpott

Issue #2285083 by crowdcg, andypost, larowlan: Rename contact category to contact form.

parent 0d510d72
......@@ -208,7 +208,7 @@ public function doCustomContentTypeListTest() {
public function doContactFormsListTest() {
// Create a test contact form to decouple looking for translate operations
// link so this does not test more than necessary.
$contact_form = entity_create('contact_category', array(
$contact_form = entity_create('contact_form', array(
'id' => Unicode::strtolower($this->randomMachineName(16)),
'label' => $this->randomMachineName(),
));
......
......@@ -228,7 +228,7 @@ public function testSourceValueDuplicateSave() {
}
/**
* Tests the contact category translation.
* Tests the contact form translation.
*/
public function testContactConfigEntityTranslation() {
$this->drupalLogin($this->admin_user);
......@@ -268,15 +268,15 @@ public function testContactConfigEntityTranslation() {
// Update translatable fields.
$edit = array(
'config_names[contact.category.feedback][label][translation]' => 'Website feedback - ' . $langcode,
'config_names[contact.category.feedback][reply][translation]' => 'Thank you for your mail - ' . $langcode,
'config_names[contact.form.feedback][label][translation]' => 'Website feedback - ' . $langcode,
'config_names[contact.form.feedback][reply][translation]' => 'Thank you for your mail - ' . $langcode,
);
// Save language specific version of form.
$this->drupalPostForm($translation_page_url, $edit, t('Save translation'));
// Expect translated values in language specific file.
$override = \Drupal::languageManager()->getLanguageConfigOverride($langcode, 'contact.category.feedback');
$override = \Drupal::languageManager()->getLanguageConfigOverride($langcode, 'contact.form.feedback');
$expected = array(
'label' => 'Website feedback - ' . $langcode,
'reply' => 'Thank you for your mail - ' . $langcode,
......@@ -307,7 +307,7 @@ public function testContactConfigEntityTranslation() {
$langcode_prefixes = array_merge(array(''), $this->langcodes);
foreach ($langcode_prefixes as $langcode_prefix) {
$this->drupalGet(ltrim("$langcode_prefix/$translation_base_url/$langcode/edit"));
$this->assertFieldByName('config_names[contact.category.feedback][label][translation]', 'Website feedback - ' . $langcode);
$this->assertFieldByName('config_names[contact.form.feedback][label][translation]', 'Website feedback - ' . $langcode);
$this->assertText($label);
}
}
......@@ -325,7 +325,7 @@ public function testContactConfigEntityTranslation() {
// Test that delete links work and operations perform properly.
foreach ($this->langcodes as $langcode) {
$replacements = array('%label' => t('!label !entity_type', array('!label' => $label, '!entity_type' => Unicode::strtolower(t('Contact category')))), '@language' => language_load($langcode)->name);
$replacements = array('%label' => t('!label !entity_type', array('!label' => $label, '!entity_type' => Unicode::strtolower(t('Contact form')))), '@language' => language_load($langcode)->name);
$this->drupalGet("$translation_base_url/$langcode/delete");
$this->assertRaw(t('Are you sure you want to delete the @language translation of %label?', $replacements));
......@@ -339,7 +339,7 @@ public function testContactConfigEntityTranslation() {
$this->assertNoLinkByHref("$translation_base_url/$langcode/delete");
// Expect no language specific file present anymore.
$override = \Drupal::languageManager()->getLanguageConfigOverride($langcode, 'contact.category.feedback');
$override = \Drupal::languageManager()->getLanguageConfigOverride($langcode, 'contact.form.feedback');
$this->assertTrue($override->isNew());
}
......
default_category: feedback
default_form: feedback
flood:
limit: 5
interval: 3600
......
# Schema for the configuration files of the Contact module.
contact.category.*:
contact.form.*:
type: config_entity
label: 'Contact category'
label: 'Contact form'
mapping:
id:
type: string
......@@ -27,9 +27,9 @@ contact.settings:
type: mapping
label: 'Contact settings'
mapping:
default_category:
default_form:
type: string
label: 'Default category identifier'
label: 'Default form identifier'
flood:
type: mapping
label: 'Flood control'
......
......@@ -4,4 +4,4 @@ description: 'Enables the use of both personal and site-wide contact forms.'
package: Core
version: VERSION
core: 8.x
configure: contact.category_list
configure: contact.form_list
......@@ -15,11 +15,11 @@ function contact_install() {
if (empty($site_mail)) {
$site_mail = ini_get('sendmail_from');
}
$config = \Drupal::config('contact.category.feedback');
$config = \Drupal::config('contact.form.feedback');
// Update the recipients if the default configuration entity has been created.
// We should never rely on default config entities as during enabling a module
// during config sync they will not exist.
if (!$config->isNew()) {
\Drupal::config('contact.category.feedback')->set('recipients', array($site_mail))->save();
\Drupal::config('contact.form.feedback')->set('recipients', array($site_mail))->save();
}
}
contact.category_add:
route_name: contact.category_add
title: 'Add category'
contact.form_add:
route_name: contact.form_add
title: 'Add contact form'
weight: 1
appears_on:
- contact.category_list
- contact.form_list
contact.category_list:
title: 'Contact form categories'
contact.form_list:
title: 'Contact forms'
parent: system.admin_structure
description: 'Create a system contact form and set up categories for the form to use.'
route_name: contact.category_list
description: 'Create and manage contact forms.'
route_name: contact.form_list
contact.site_page:
title: Contact
route_name: contact.site_page
......
entity.contact_category.edit_form:
entity.contact_form.edit_form:
title: 'Edit'
route_name: entity.contact_category.edit_form
base_route: entity.contact_category.edit_form
route_name: entity.contact_form.edit_form
base_route: entity.contact_form.edit_form
contact.personal_page:
title: 'Contact'
......
......@@ -22,7 +22,7 @@ function contact_help($route_name, RouteMatchInterface $route_match) {
$output .= '<dt>' . t('User contact forms') . '</dt>';
$output .= '<dd>' . t('Site users can be contacted with a user contact form that keeps their email address private. Users may enable or disable their personal contact forms by editing their <em>My account</em> page. If enabled, a <em>Contact</em> tab leads to a personal contact form displayed on their user profile. Site administrators are still able to use the contact form, even if has been disabled. The <em>Contact</em> tab is not shown when you view your own profile.') . '</dd>';
$output .= '<dt>' . t('Site-wide contact forms') . '</dt>';
$output .= '<dd>' . t('The <a href="@contact">Contact page</a> provides a simple form for users with the <em>Use the site-wide contact form</em> permission to send comments, feedback, or other requests. You can create categories for directing the contact form messages to a set of defined recipients. Common categories for a business site, for example, might include "Website feedback" (messages are forwarded to website administrators) and "Product information" (messages are forwarded to members of the sales department). Email addresses defined within a category are not displayed publicly.', array('@contact' => url('contact'))) . '</p>';
$output .= '<dd>' . t('The <a href="@contact">Contact page</a> provides a simple form for users with the <em>Use the site-wide contact form</em> permission to send comments, feedback, or other requests. You can create forms for directing the contact messages to a set of defined recipients. Common forms for a business site, for example, might include "Website feedback" (messages are forwarded to website administrators) and "Product information" (messages are forwarded to members of the sales department). Email addresses defined within a form are not displayed publicly.', array('@contact' => url('contact'))) . '</p>';
$output .= '<dt>' . t('Navigation') . '</dt>';
$output .= '<dd>' . t('When the site-wide contact form is enabled, a link in the <em>Footer</em> menu is created, which you can modify on the <a href="@menu">Menus administration page</a>.', array('@menu' => url('admin/structure/menu'))) . '</dd>';
$output .= '<dt>' . t('Customization') . '</dt>';
......@@ -30,8 +30,8 @@ function contact_help($route_name, RouteMatchInterface $route_match) {
$output .= '</dl>';
return $output;
case 'contact.category_list':
$output = '<p>' . t('Add one or more categories on this page to set up your site-wide <a href="@form">contact form</a>.', array('@form' => url('contact'))) . '</p>';
case 'contact.form_list':
$output = '<p>' . t('Add one or more forms on this page to set up your site-wide <a href="@form">contact form</a>.', array('@form' => url('contact'))) . '</p>';
$output .= '<p>' . t('A <em>Contact</em> menu item is added to the <em>Footer</em> menu, which you can modify on the <a href="@menu-settings">Menus administration page</a>.', array('@menu-settings' => url('admin/structure/menu'))) . '</p>';
$output .= '<p>' . t('If you would like additional text to appear on the site-wide contact page, use a block. You can create and edit blocks on the <a href="@blocks">Blocks administration page</a>.', array('@blocks' => url('admin/structure/block'))) . '</p>';
return $output;
......@@ -113,7 +113,7 @@ function contact_mail($key, &$message, $params) {
$variables = array(
'!site-name' => \Drupal::config('system.site')->get('name'),
'!subject' => $contact_message->getSubject(),
'!category' => !empty($params['contact_category']) ? $params['contact_category']->label() : NULL,
'!form' => !empty($params['contact_form']) ? $params['contact_form']->label() : NULL,
'!form-url' => url(current_path(), array('absolute' => TRUE, 'language' => $language)),
'!sender-name' => user_format_name($sender),
);
......@@ -129,15 +129,15 @@ function contact_mail($key, &$message, $params) {
switch ($key) {
case 'page_mail':
case 'page_copy':
$message['subject'] .= t('[!category] !subject', $variables, $options);
$message['subject'] .= t('[!form] !subject', $variables, $options);
$message['body'][] = t("!sender-name (!sender-url) sent a message using the contact form at !form-url.", $variables, $options);
$build = entity_view($contact_message, 'mail', $language->id);
$message['body'][] = drupal_render($build);
break;
case 'page_autoreply':
$message['subject'] .= t('[!category] !subject', $variables, $options);
$message['body'][] = $params['contact_category']->reply;
$message['subject'] .= t('[!form] !subject', $variables, $options);
$message['body'][] = $params['contact_form']->reply;
break;
case 'user_mail':
......
entity.contact_category.delete_form:
path: '/admin/structure/contact/manage/{contact_category}/delete'
entity.contact_form.delete_form:
path: '/admin/structure/contact/manage/{contact_form}/delete'
defaults:
_entity_form: 'contact_category.delete'
_entity_form: 'contact_form.delete'
_title: 'Delete'
requirements:
_entity_access: 'contact_category.delete'
_entity_access: 'contact_form.delete'
contact.category_list:
contact.form_list:
path: '/admin/structure/contact'
defaults:
_entity_list: 'contact_category'
_title: 'Contact form categories'
_entity_list: 'contact_form'
_title: 'Contact forms'
requirements:
_permission: 'administer contact forms'
contact.category_add:
contact.form_add:
path: '/admin/structure/contact/add'
defaults:
_entity_form: 'contact_category.add'
_title: 'Add category'
_entity_form: 'contact_form.add'
_title: 'Add contact form'
requirements:
_permission: 'administer contact forms'
entity.contact_category.edit_form:
path: '/admin/structure/contact/manage/{contact_category}'
entity.contact_form.edit_form:
path: '/admin/structure/contact/manage/{contact_form}'
defaults:
_entity_form: 'contact_category.edit'
_title: 'Edit contact category'
_entity_form: 'contact_form.edit'
_title: 'Edit contact form'
requirements:
_entity_access: 'contact_category.update'
_entity_access: 'contact_form.update'
contact.site_page:
path: '/contact'
defaults:
_title: 'Contact'
_content: '\Drupal\contact\Controller\ContactController::contactSitePage'
contact_category: NULL
contact_form: NULL
requirements:
_permission: 'access site-wide contact form'
contact.site_page_category:
path: '/contact/{contact_category}'
contact.site_page_form:
path: '/contact/{contact_form}'
defaults:
_title: 'Contact category form'
_title: 'Contact'
_content: '\Drupal\contact\Controller\ContactController::contactSitePage'
requirements:
_entity_access: 'contact_category.view'
_entity_access: 'contact_form.view'
contact.personal_page:
path: '/user/{user}/contact'
......
......@@ -2,7 +2,7 @@
/**
* @file
* Contains \Drupal\contact\CategoryAccessControlHandler.
* Contains \Drupal\contact\ContactFormAccessControlHandler.
*/
namespace Drupal\contact;
......@@ -12,22 +12,22 @@
use Drupal\Core\Session\AccountInterface;
/**
* Defines the access control handler for the contact category entity type.
* Defines the access control handler for the contact form entity type.
*
* @see \Drupal\contact\Entity\Category
* @see \Drupal\contact\Entity\ContactForm.
*/
class CategoryAccessControlHandler extends EntityAccessControlHandler {
class ContactFormAccessControlHandler extends EntityAccessControlHandler {
/**
* {@inheritdoc}
*/
public function checkAccess(EntityInterface $entity, $operation, $langcode, AccountInterface $account) {
if ($operation == 'view') {
// Do not allow access personal category via site-wide route.
// Do not allow access personal form via site-wide route.
return $account->hasPermission('access site-wide contact form') && $entity->id() !== 'personal';
}
elseif ($operation == 'delete' || $operation == 'update') {
// Do not allow the 'personal' category to be deleted, as it's used for
// Do not allow the 'personal' form to be deleted, as it's used for
// the personal contact form.
return $account->hasPermission('administer contact forms') && $entity->id() !== 'personal';
}
......
......@@ -2,7 +2,7 @@
/**
* @file
* Contains \Drupal\contact\CategoryForm.
* Contains \Drupal\contact\ContactFormEditForm.
*/
namespace Drupal\contact;
......@@ -12,9 +12,9 @@
use Drupal\Core\Form\FormStateInterface;
/**
* Base form for category edit forms.
* Base form for contact form edit forms.
*/
class CategoryForm extends EntityForm {
class ContactFormEditForm extends EntityForm {
/**
* {@inheritdoc}
......@@ -22,49 +22,49 @@ class CategoryForm extends EntityForm {
public function form(array $form, FormStateInterface $form_state) {
$form = parent::form($form, $form_state);
$category = $this->entity;
$default_category = $this->config('contact.settings')->get('default_category');
$contact_form = $this->entity;
$default_form = $this->config('contact.settings')->get('default_form');
$form['label'] = array(
'#type' => 'textfield',
'#title' => $this->t('Label'),
'#maxlength' => 255,
'#default_value' => $category->label(),
'#default_value' => $contact_form->label(),
'#description' => $this->t("Example: 'website feedback' or 'product information'."),
'#required' => TRUE,
);
$form['id'] = array(
'#type' => 'machine_name',
'#default_value' => $category->id(),
'#default_value' => $contact_form->id(),
'#maxlength' => EntityTypeInterface::BUNDLE_MAX_LENGTH,
'#machine_name' => array(
'exists' => '\Drupal\contact\Entity\Category::load',
'exists' => '\Drupal\contact\Entity\ContactForm::load',
),
'#disabled' => !$category->isNew(),
'#disabled' => !$contact_form->isNew(),
);
$form['recipients'] = array(
'#type' => 'textarea',
'#title' => $this->t('Recipients'),
'#default_value' => implode(', ', $category->recipients),
'#default_value' => implode(', ', $contact_form->recipients),
'#description' => $this->t("Example: 'webmaster@example.com' or 'sales@example.com,support@example.com' . To specify multiple recipients, separate each email address with a comma."),
'#required' => TRUE,
);
$form['reply'] = array(
'#type' => 'textarea',
'#title' => $this->t('Auto-reply'),
'#default_value' => $category->reply,
'#default_value' => $contact_form->reply,
'#description' => $this->t('Optional auto-reply. Leave empty if you do not want to send the user an auto-reply message.'),
);
$form['weight'] = array(
'#type' => 'weight',
'#title' => $this->t('Weight'),
'#default_value' => $category->weight,
'#description' => $this->t('When listing categories, those with lighter (smaller) weights get listed before categories with heavier (larger) weights. Categories with equal weights are sorted alphabetically.'),
'#default_value' => $contact_form->weight,
'#description' => $this->t('When listing forms, those with lighter (smaller) weights get listed before forms with heavier (larger) weights. Forms with equal weights are sorted alphabetically.'),
);
$form['selected'] = array(
'#type' => 'checkbox',
'#title' => $this->t('Make this the default category.'),
'#default_value' => $default_category === $category->id(),
'#title' => $this->t('Make this the default form.'),
'#default_value' => $default_form === $contact_form->id(),
);
return $form;
......@@ -92,35 +92,35 @@ public function validate(array $form, FormStateInterface $form_state) {
* {@inheritdoc}
*/
public function save(array $form, FormStateInterface $form_state) {
$category = $this->entity;
$status = $category->save();
$contact_form = $this->entity;
$status = $contact_form->save();
$contact_settings = $this->config('contact.settings');
$edit_link = \Drupal::linkGenerator()->generateFromUrl($this->t('Edit'), $this->entity->urlInfo());
if ($status == SAVED_UPDATED) {
drupal_set_message($this->t('Category %label has been updated.', array('%label' => $category->label())));
$this->logger('contact')->notice('Category %label has been updated.', array('%label' => $category->label(), 'link' => $edit_link));
drupal_set_message($this->t('Contact form %label has been updated.', array('%label' => $contact_form->label())));
$this->logger('contact')->notice('Contact form %label has been updated.', array('%label' => $contact_form->label(), 'link' => $edit_link));
}
else {
drupal_set_message($this->t('Category %label has been added.', array('%label' => $category->label())));
$this->logger('contact')->notice('Category %label has been added.', array('%label' => $category->label(), 'link' => $edit_link));
drupal_set_message($this->t('Contact form %label has been added.', array('%label' => $contact_form->label())));
$this->logger('contact')->notice('Contact form %label has been added.', array('%label' => $contact_form->label(), 'link' => $edit_link));
}
// Update the default category.
// Update the default form.
if ($form_state->getValue('selected')) {
$contact_settings
->set('default_category', $category->id())
->set('default_form', $contact_form->id())
->save();
}
// If it was the default category, empty out the setting.
elseif ($contact_settings->get('default_category') == $category->id()) {
// If it was the default form, empty out the setting.
elseif ($contact_settings->get('default_form') == $contact_form->id()) {
$contact_settings
->set('default_category', NULL)
->set('default_form', NULL)
->save();
}
$form_state->setRedirect('contact.category_list');
$form_state->setRedirect('contact.form_list');
}
}
......@@ -2,7 +2,7 @@
/**
* @file
* Contains \Drupal\contact\Entity\CategoryInterface.
* Contains \Drupal\contact\Entity\ContactFormInterface.
*/
namespace Drupal\contact;
......@@ -10,8 +10,8 @@
use Drupal\Core\Config\Entity\ConfigEntityInterface;
/**
* Provides an interface defining a contact category entity.
* Provides an interface defining a contact form entity.
*/
interface CategoryInterface extends ConfigEntityInterface {
interface ContactFormInterface extends ConfigEntityInterface {
}
......@@ -2,7 +2,7 @@
/**
* @file
* Contains \Drupal\contact\CategoryListBuilder.
* Contains \Drupal\contact\ContactFormListBuilder.
*/
namespace Drupal\contact;
......@@ -12,17 +12,17 @@
use Drupal\Core\Entity\EntityInterface;
/**
* Defines a class to build a listing of contact category entities.
* Defines a class to build a listing of contact form entities.
*
* @see \Drupal\contact\Entity\Category
* @see \Drupal\contact\Entity\ContactForm
*/
class CategoryListBuilder extends ConfigEntityListBuilder {
class ContactFormListBuilder extends ConfigEntityListBuilder {
/**
* {@inheritdoc}
*/
public function buildHeader() {
$header['category'] = t('Category');
$header['form'] = t('Form');
$header['recipients'] = t('Recipients');
$header['selected'] = t('Selected');
return $header + parent::buildHeader();
......@@ -32,16 +32,16 @@ public function buildHeader() {
* {@inheritdoc}
*/
public function buildRow(EntityInterface $entity) {
$row['category'] = $this->getLabel($entity);
// Special case the personal category.
$row['form'] = $this->getLabel($entity);
// Special case the personal form.
if ($entity->id() == 'personal') {
$row['recipients'] = t('Selected user');
$row['selected'] = t('No');
}
else {
$row['recipients'] = String::checkPlain(implode(', ', $entity->recipients));
$default_category = \Drupal::config('contact.settings')->get('default_category');
$row['selected'] = ($default_category == $entity->id() ? t('Yes') : t('No'));
$default_form = \Drupal::config('contact.settings')->get('default_form');
$row['selected'] = ($default_form == $entity->id() ? t('Yes') : t('No'));
}
return $row + parent::buildRow($entity);
}
......
......@@ -10,7 +10,7 @@
use Drupal\Core\Controller\ControllerBase;
use Drupal\Core\Datetime\DateFormatter;
use Drupal\Core\Flood\FloodInterface;
use Drupal\contact\CategoryInterface;
use Drupal\contact\ContactFormInterface;
use Drupal\user\UserInterface;
use Drupal\Component\Utility\String;
use Symfony\Component\DependencyInjection\ContainerInterface;
......@@ -62,32 +62,32 @@ public static function create(ContainerInterface $container) {
/**
* Presents the site-wide contact form.
*
* @param \Drupal\contact\CategoryInterface $contact_category
* The contact category to use.
* @param \Drupal\contact\ContactFormInterface $contact_form
* The contact form to use.
*
* @return array
* The form as render array as expected by drupal_render().
*
* @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
* Exception is thrown when user tries to access non existing default
* contact category form.
* contact form.
*/
public function contactSitePage(CategoryInterface $contact_category = NULL) {
public function contactSitePage(ContactFormInterface $contact_form = NULL) {
// Check if flood control has been activated for sending emails.
if (!$this->currentUser()->hasPermission('administer contact forms')) {
$this->contactFloodControl();
}
// Use the default category if no category has been passed.
if (empty($contact_category)) {
$contact_category = $this->entityManager()
->getStorage('contact_category')
->load($this->config('contact.settings')->get('default_category'));
// If there are no categories, do not display the form.
if (empty($contact_category)) {
// Use the default form if no form has been passed.
if (empty($contact_form)) {
$contact_form = $this->entityManager()
->getStorage('contact_form')
->load($this->config('contact.settings')->get('default_form'));
// If there are no forms, do not display the form.
if (empty($contact_form)) {
if ($this->currentUser()->hasPermission('administer contact forms')) {
drupal_set_message($this->t('The contact form has not been configured. <a href="@add">Add one or more categories</a> to the form.', array(
'@add' => $this->url('contact.category_add'))), 'error');
drupal_set_message($this->t('The contact form has not been configured. <a href="@add">Add one or more forms</a> .', array(
'@add' => $this->url('contact.form_add'))), 'error');
return array();
}
else {
......@@ -99,11 +99,11 @@ public function contactSitePage(CategoryInterface $contact_category = NULL) {
$message = $this->entityManager()
->getStorage('contact_message')
->create(array(
'category' => $contact_category->id(),
'contact_form' => $contact_form->id(),
));
$form = $this->entityFormBuilder()->getForm($message);
$form['#title'] = String::checkPlain($contact_category->label());
$form['#title'] = String::checkPlain($contact_form->label());
return $form;
}
......@@ -123,7 +123,7 @@ public function contactPersonalPage(UserInterface $user) {
}
$message = $this->entityManager()->getStorage('contact_message')->create(array(
'category' => 'personal',
'contact_form' => 'personal',
'recipient' => $user->id(),
));
......
......@@ -2,7 +2,7 @@
/**
* @file
* Definition of Drupal\contact\Entity\Category.
* Contains \Drupal\contact\Entity\ContactForm.
*/
namespace Drupal\contact\Entity;
......@@ -10,24 +10,24 @@
use Drupal\Core\Config\Entity\ConfigEntityBase;
use Drupal\Core\Config\Entity\ConfigEntityBundleBase;
use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\contact\CategoryInterface;
use Drupal\contact\ContactFormInterface;
/**
* Defines the contact category entity.
* Defines the contact form entity.
*
* @ConfigEntityType(
* id = "contact_category",
* label = @Translation("Contact category"),
* id = "contact_form",
* label = @Translation("Contact form"),
* controllers = {
* "access" = "Drupal\contact\CategoryAccessControlHandler",
* "list_builder" = "Drupal\contact\CategoryListBuilder",
* "access" = "Drupal\contact\ContactFormAccessControlHandler",
* "list_builder" = "Drupal\contact\ContactFormListBuilder",
* "form" = {
* "add" = "Drupal\contact\CategoryForm",
* "edit" = "Drupal\contact\CategoryForm",
* "delete" = "Drupal\contact\Form\CategoryDeleteForm"
* "add" = "Drupal\contact\ContactFormEditForm",
* "edit" = "Drupal\contact\ContactFormEditForm",
* "delete" = "Drupal\contact\Form\ContactFormDeleteForm"
* }
* },
* config_prefix = "category",
* config_prefix = "form",
* admin_permission = "administer contact forms",
* bundle_of = "contact_message",
* entity_keys = {
......@@ -35,22 +35,22 @@
* "label" = "label"
* },
* links = {
* "delete-form" = "entity.contact_category.delete_form",
* "edit-form" = "entity.contact_category.edit_form"
* "delete-form" = "entity.contact_form.delete_form",
* "edit-form" = "entity.contact_form.edit_form"
* }
* )
*/
class Category extends ConfigEntityBundleBase implements CategoryInterface {
class ContactForm extends ConfigEntityBundleBase implements ContactFormInterface {
/**
* The category ID.
* The form ID.
*
* @var string
*/
public $id;
/**
* The category label.
* The form label.
*
* @var string
*/
......@@ -71,7 +71,7 @@ class Category extends ConfigEntityBundleBase implements CategoryInterface {
public $reply = '';
/**
* Weight of this category (used for sorting).
* Weight of this form (used for sorting).
*
* @var int
*/
......
......@@ -26,13 +26,13 @@
* }
* },
* entity_keys = {
* "bundle" = "category",
* "bundle" = "contact_form",
* "uuid" = "uuid"
* },