Skip to content

Marketing Form API returns error when form is configured as English (British) #604

@Skullsneeze

Description

@Skullsneeze

In codegen/Marketing/Forms/Model/HubSpotFormConfiguration.php:345 a list of allowed languages is provided through getLanguageAllowableValues(). This list does include en but when a form is configured to use "English (British)" in Hubspot the value returned for this is en-gb.

When requesting this form using the marketing API (eg. $client->marketing()->forms()->formsApi()->getById($formId)) an exception is thrown, saying the language is invalid.

Solution: Add the en-gb language to the list.

Temporary patch if anyone needs to fix this locally:

--- codegen/Marketing/Forms/Model/HubSpotFormConfiguration.php    2026-04-16 11:41:32
+++ codegen/Marketing/Forms/Model/HubSpotFormConfiguration.php    2026-04-16 11:41:47
@@ -387,6 +387,7 @@
             self::LANGUAGE_ZH_CN,
             self::LANGUAGE_ZH_HK,
             self::LANGUAGE_ZH_TW,
+            'en-gb', // TMP FIX
         ];
     }
 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions