Skip to content

Remove Legacy Forms from Settings Dropdowns - #1152

Open
n7studios wants to merge 5 commits into
mainfrom
remove-legacy-forms-dropdown
Open

Remove Legacy Forms from Settings Dropdowns#1152
n7studios wants to merge 5 commits into
mainfrom
remove-legacy-forms-dropdown

Conversation

@n7studios

@n7studios n7studios commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Removes legacy Kit forms from every settings dropdown across the plugin, while preserving any legacy form ID already saved to a post, page, category, block, integration mapping or plugin setting.

Legacy forms are a deprecated Kit resource. New assignments should always be to v4 forms, but existing customers who already have legacy forms selected should continue to work at this time - both at render time and in the admin UI, where the saved legacy form should still show as the currently-selected dropdown option rather than silently reverting to "None".

Testing

Tests added:

Integration (tests/Integration/ResourceFormsTest.php):

  • testGetNonLegacyget_non_legacy() returns v4 forms and excludes legacy; every returned form has a format key
  • testNonLegacyExist — helper returns true when at least one v4 form exists
  • testGetSelectFieldAllExcludesLegacyForms — rendered HTML has no <option> for the legacy form when a v4 form is the selected value
  • testGetSelectFieldAllPreservesSelectedLegacyForm — when a legacy form ID is the selected value, the option is appended and marked selected

End-to-end:

  • SelectOptionOrderCest::testLegacyFormsExcludedFromDropdowns — no legacy <option> in Post metabox, Page metabox, Category term Add, Settings > Kit > General
  • SelectOptionOrderCest::testPreservesSelectedLegacyFormInDefaultFormsSetting — Settings > Kit > General with a legacy form pre-assigned still shows it as selected
  • SelectOptionOrderCest::testPreservesSelectedLegacyFormOnCategoryTerm — Category term with a legacy form in term meta still shows it as selected
  • SelectOptionOrderCest::testPreservesSelectedLegacyFormOnPostMetabox — Post with a legacy form in post meta still shows it as selected in the classic-editor metabox
  • PageBlockFormCest::testFormBlockSidebarDropdownExcludesLegacyForms — Kit Form block sidebar Form dropdown has no legacy option
  • PageBlockFormCest::testFormBlockPreservesSelectedLegacyForm — Kit Form block preseeded with a legacy form attribute still shows it as selected in the sidebar AND renders on the frontend
  • PageBlockFormBuilderCest::testFormBuilderBlockSidebarFormDropdownExcludesLegacyForms — Form Builder block sidebar form_id dropdown has no legacy option
  • PageBlockFormBuilderCest::testFormBuilderBlockPreservesSelectedLegacyForm — Form Builder block preseeded with a legacy form_id attribute still shows it as selected in the sidebar
  • BlockEditorFormCest::testPluginSidebarFormDropdownExcludesLegacyForms — Gutenberg plugin sidebar Form dropdown has no legacy option across page, post, article
  • BlockEditorFormCest::testPluginSidebarPreservesSelectedLegacyForm — Page with a legacy form in post meta still shows it as selected in the Gutenberg plugin sidebar

Tests removed (all previously selected a legacy form via a dropdown, which the dropdown no longer offers):

  • PageBlockFormCest::testFormBlockWithValidLegacyFormParameter
  • PageBlockFormBuilderCest::testFormBuilderBlockWithLegacyFormEnabled
  • ClassicEditorFormCest::testAddNewPostTypeUsingDefinedLegacyForm
  • BlockEditorFormCest::testAddNewPostTypeUsingDefinedLegacyForm
  • WidgetFormCest::testLegacyFormWidgetWithValidLegacyFormParameter
  • WidgetFormCest::testBlockFormBlockWithValidLegacyFormParameter
  • EditFormLinkCest::testEditFormLinkOnPageWithLegacyForm
  • ContactForm7FormCest::testSettingsContactForm7ToKitLegacyFormMapping
  • ForminatorCest::testSettingsForminatorFormToKitLegacyFormMapping
  • WishListMemberCest::testWLMToKitLegacyFormMappingOnLevelAdded
  • WishListMemberCest::testWLMToKitLegacyFormMappingOnLevelRemoved
  • ElementorFormCest::testFormWidgetWithValidLegacyFormParameter
  • DiviPluginFormCest::testFormModuleWithValidLegacyFormParameter
  • DiviThemeFormCest::testFormModuleWithValidLegacyFormParameter

Checklist

@n7studios n7studios added this to the 3.3.7 milestone Jul 29, 2026
@n7studios n7studios self-assigned this Jul 29, 2026
@github-actions

Copy link
Copy Markdown

WordPress Playground

🚀 Your PR has been built and is ready for testing in WordPress Playground!

Click here to test your changes in WordPress Playground

@n7studios
n7studios requested review from a team, ciccio-kit and noelherrick and removed request for a team July 30, 2026 08:37
@n7studios
n7studios marked this pull request as ready for review July 30, 2026 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant