Skip to content

Commit

Permalink
[#127] Machine names have a maximum length of 32 characters
Browse files Browse the repository at this point in the history
Closes #127 Machine names have a maximum length of 32 characters
  • Loading branch information
phdhiren authored Jul 29, 2021
2 parents 6467786 + 1764ce6 commit d4e41ec
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/UpdateService.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ public function update8803() {
if (substr($fieldName, 0, 6) === 'field_') {

// Namespace this custom field to avoid collisions.
$newFieldName = $fieldName . '_apidoc';
// Machine names have a maximum length of 32 characters https://www.drupal.org/node/2232665
$newFieldName = substr($fieldName . '_apidoc', 0, 32);

if (!FieldStorageConfig::loadByName('node', $newFieldName)) {
$fieldStorageConfig->create([
Expand Down

0 comments on commit d4e41ec

Please sign in to comment.