Loading src/Service/BlockClassHelperService.php +24 −0 Original line number Diff line number Diff line Loading @@ -396,6 +396,26 @@ class BlockClassHelperService { $form_state->setErrorByName('third_party_settings[block_class][attributes]', $this->t("You need to insert a pipe on attributes field")); return FALSE; } // Prevent attribute id. if (str_contains($attributes, 'id|')) { $form_state->setErrorByName('third_party_settings[block_class][attributes]', $this->t("You can't the attribute id")); return FALSE; } // Prevent attribute class. if (str_contains($attributes, 'class|')) { $form_state->setErrorByName('third_party_settings[block_class][attributes]', $this->t("You can't use class. Use the field class instead")); return FALSE; } // If it's only one line, skip. Loading @@ -408,7 +428,11 @@ class BlockClassHelperService { foreach ($attributes as $attribute) { if (!str_contains($attribute, '|')) { $form_state->setErrorByName('third_party_settings[block_class][attributes]', $this->t("You need to insert a pipe on attributes field")); return FALSE; } } Loading Loading
src/Service/BlockClassHelperService.php +24 −0 Original line number Diff line number Diff line Loading @@ -396,6 +396,26 @@ class BlockClassHelperService { $form_state->setErrorByName('third_party_settings[block_class][attributes]', $this->t("You need to insert a pipe on attributes field")); return FALSE; } // Prevent attribute id. if (str_contains($attributes, 'id|')) { $form_state->setErrorByName('third_party_settings[block_class][attributes]', $this->t("You can't the attribute id")); return FALSE; } // Prevent attribute class. if (str_contains($attributes, 'class|')) { $form_state->setErrorByName('third_party_settings[block_class][attributes]', $this->t("You can't use class. Use the field class instead")); return FALSE; } // If it's only one line, skip. Loading @@ -408,7 +428,11 @@ class BlockClassHelperService { foreach ($attributes as $attribute) { if (!str_contains($attribute, '|')) { $form_state->setErrorByName('third_party_settings[block_class][attributes]', $this->t("You need to insert a pipe on attributes field")); return FALSE; } } Loading