From 476d6fb9f7aeb31a14dbb85b7777506b15854e84 Mon Sep 17 00:00:00 2001
From: Kristiaan Van den Eynde <magentix@gmail.com>
Date: Wed, 23 Dec 2015 12:37:49 +0100
Subject: [PATCH] Issue #2553765 by heykarthikwithu, StryKaizer, damiankloip,
 Jeremy, kristiaanvandeneynde: Actions created in user_user_role_insert
 contain a '.' and cannot be updated via the UI

---
 core/modules/action/src/ActionFormBase.php | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/core/modules/action/src/ActionFormBase.php b/core/modules/action/src/ActionFormBase.php
index 0b972d4..850894f 100644
--- a/core/modules/action/src/ActionFormBase.php
+++ b/core/modules/action/src/ActionFormBase.php
@@ -81,6 +81,14 @@ public function form(array $form, FormStateInterface $form_state) {
         'exists' => array($this, 'exists'),
       ),
     );
+
+    // Disable machine name validation for existing actions because the machine
+    // name element is disabled and may contain a period if it was generated in
+    // user_user_role_insert().
+    if (!$this->entity->isNew()) {
+      $form['id']['#element_validate'] = [];
+    }
+
     $form['plugin'] = array(
       '#type' => 'value',
       '#value' => $this->entity->get('plugin'),
-- 
2.4.9 (Apple Git-60)

