Skip to content
Snippets Groups Projects
Commit 42c9987f authored by baldwinlouie's avatar baldwinlouie Committed by Yas Naoi
Browse files

Issue #3085603 by baldwinlouie, yas: Fix an Internal Server Error when...

Issue #3085603 by baldwinlouie, yas: Fix an Internal Server Error when unacceptable characters are submitted in K8s server template form
parent 06436aa9
No related branches found
No related tags found
No related merge requests found
......@@ -18,6 +18,7 @@ use Drupal\field\Entity\FieldStorageConfig;
use Drupal\cloud\Entity\CloudConfig;
use Drupal\k8s\Entity\K8sNamespace;
use Drupal\k8s\Service\K8sServiceException;
use Drupal\Core\Entity\EntityTypeInterface;
/**
* Implements hook_cloud_config_update().
......@@ -622,6 +623,15 @@ function k8s_server_template_field_orders($include_name = TRUE) {
return $fieldsets_def;
}
function k8s_entity_bundle_field_info_alter(&$fields, \Drupal\Core\Entity\EntityTypeInterface $entity_type, $bundle) {
if ($bundle === 'k8s') {
if (isset($fields['field_detail'])) {
// Use the ID as defined in the annotation of the constraint definition
$fields['field_detail']->addConstraint('yaml_array_data', []);
}
}
}
/**
* Implements hook_cron().
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment