When adding a new entity type with a machine name of over 32 characters, the site breaks.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

legolasbo created an issue. See original summary.

  • legolasbo committed 9794723 on 8.x-1.x
    Issue #2759989: Attempting to add an entity type with too long machine...
legolasbo’s picture

Priority: Critical » Normal

Committed a fix that sets a max length on the machine name form field. This however does not prevent against creating an entity with a machine name that's too long in code. I will therefore leave this issue open until a proper fix has been committed.

legolasbo’s picture

Attached patch adds validation to the EckEntityType class to ensure the machine name is below 27 characters.

The reason for 27 characters is because of the fact that there are 5 characters needed for the bundle machine name which consits of entity machine name + '_type'

legolasbo’s picture

Status: Needs review » Needs work

Still needs work because the original fix limits machine names to 32 which still allows for things to go wrong. Additional tests are needed for the form as well.

legolasbo’s picture

Add attribution for Deeson

Matroskeen’s picture

Issue tags: +LutskGSW18
legolasbo’s picture

Status: Needs work » Closed (duplicate)

Closing this as a duplicate of #2975136: WSOD by creating types: Limit of 32 chars exceeded when creating machine name ID with too much characters which has a test covered patch that's in review.