upgrades core to 8.4.2
This commit is contained in:
@@ -20,12 +20,12 @@ class ContactFormAccessControlHandler extends EntityAccessControlHandler {
|
||||
protected function checkAccess(EntityInterface $entity, $operation, AccountInterface $account) {
|
||||
if ($operation == 'view') {
|
||||
// Do not allow access personal form via site-wide route.
|
||||
return AccessResult::allowedIf($account->hasPermission('access site-wide contact form') && $entity->id() !== 'personal')->cachePerPermissions();
|
||||
return AccessResult::allowedIfHasPermission($account, 'access site-wide contact form')->andIf(AccessResult::allowedIf($entity->id() !== 'personal'));
|
||||
}
|
||||
elseif ($operation == 'delete' || $operation == 'update') {
|
||||
// Do not allow the 'personal' form to be deleted, as it's used for
|
||||
// the personal contact form.
|
||||
return AccessResult::allowedIf($account->hasPermission('administer contact forms') && $entity->id() !== 'personal')->cachePerPermissions();
|
||||
return AccessResult::allowedIfHasPermission($account, 'administer contact forms')->andIf(AccessResult::allowedIf($entity->id() !== 'personal'));
|
||||
}
|
||||
|
||||
return parent::checkAccess($entity, $operation, $account);
|
||||
|
||||
@@ -65,7 +65,8 @@ class ContactController extends ControllerBase {
|
||||
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 forms</a> .', [
|
||||
':add' => $this->url('contact.form_add')]), 'error');
|
||||
':add' => $this->url('contact.form_add'),
|
||||
]), 'error');
|
||||
return [];
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -13,6 +13,7 @@ use Drupal\Core\Field\BaseFieldDefinition;
|
||||
* @ContentEntityType(
|
||||
* id = "contact_message",
|
||||
* label = @Translation("Contact message"),
|
||||
* bundle_label = @Translation("Contact form"),
|
||||
* handlers = {
|
||||
* "access" = "Drupal\contact\ContactMessageAccessControlHandler",
|
||||
* "storage" = "Drupal\Core\Entity\ContentEntityNullStorage",
|
||||
@@ -107,7 +108,7 @@ class Message extends ContentEntityBase implements MessageInterface {
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function copySender() {
|
||||
return (bool)$this->get('copy')->value;
|
||||
return (bool) $this->get('copy')->value;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,7 +10,7 @@ use Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase;
|
||||
*
|
||||
* @MigrateSource(
|
||||
* id = "contact_category",
|
||||
* source_provider = "contact"
|
||||
* source_module = "contact"
|
||||
* )
|
||||
*/
|
||||
class ContactCategory extends DrupalSqlBase {
|
||||
|
||||
@@ -7,7 +7,7 @@ use Drupal\migrate_drupal\Plugin\migrate\source\Variable;
|
||||
/**
|
||||
* @MigrateSource(
|
||||
* id = "contact_settings",
|
||||
* source_provider = "contact"
|
||||
* source_module = "contact"
|
||||
* )
|
||||
*/
|
||||
class ContactSettings extends Variable {
|
||||
|
||||
Reference in New Issue
Block a user