Skip to content

Conversation

alexander-schranz
Copy link
Member

@alexander-schranz alexander-schranz commented Jun 3, 2025

Q A
Bug fix? no
New feature? no
BC breaks? yes
Deprecations? no
Fixed tickets fixes #
Related issues/PRs #
License MIT
Documentation PR sulu/sulu-docs#

What's in this PR?

Replace form metadata name with key.

Why?

Beside the name also a key was introduced in #4643 Pull Request. But seems like this are just two fields.

Currently it is very confusing as seen in a lot of tests where the setName was called with a value which make more sense for setTitle (e.g. setName('Example Template')). It is kind of intransparent here where name and where key is used and its not filled up in all cases correctly.

Both <form> and <template> xml both uses the <key> and as it we personally mostly talk about template or form keys I would go here with getKey and setKey methods over the names. The only case where FormMetadata is created by a name is inside block / image map every <type name="text_block"> is also an own form metadata. Still I would for bc reasons not rename the type attribute name here to key, but internal I would set by the name attribute the form key.

Example Usage

- $formMetadata->getName();
+ $formMetadata->getKey();

To Do

  • Add breaking changes to UPGRADE.md

@alexander-schranz alexander-schranz force-pushed the enhancement/metadata-replace-name-with-key branch 2 times, most recently from 99dbb7b to daec9cc Compare June 3, 2025 07:18
@alexander-schranz alexander-schranz added the Technical Debt Impacts code quality, no or just small impact on end developers and users label Jun 3, 2025
@alexander-schranz alexander-schranz marked this pull request as ready for review June 3, 2025 07:23
@alexander-schranz alexander-schranz force-pushed the enhancement/metadata-replace-name-with-key branch 2 times, most recently from 2f2d0f5 to 2f25c2d Compare June 3, 2025 07:49
@alexander-schranz alexander-schranz changed the title Replace form metadata name with key Replace form metadata name property with key property Jun 3, 2025
@alexander-schranz alexander-schranz force-pushed the enhancement/metadata-replace-name-with-key branch from 2f25c2d to 567caf8 Compare June 3, 2025 08:01
@alexander-schranz alexander-schranz merged commit 12015bb into sulu:3.0 Jun 3, 2025
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Technical Debt Impacts code quality, no or just small impact on end developers and users
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants