- π©πͺGermany Anybody Porta Westfalica
Still unsolved but totally makes sense. Let's use the code from other entity types that already solve this.
- π©πͺGermany Anybody Porta Westfalica
I think it might now be enough to use this form element type: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Render%21...
- Merge request !9Issue #2978978 by bgilhome: Auto-fill machine name using Name as 'source' β (Merged) created by Anybody
- π©πͺGermany Anybody Porta Westfalica
Has already been partially fixed in π Token (& token type) machine name requirements RTBC
- π©πͺGermany lrwebks Porta Westfalica
The machine name field already works on
TokenCustomTypeForm.php
, but not onTokenCustomForm.php
. @anybody suggested to me that he will take another look at this. For now, back to βNeeds workβ. - π©πͺGermany Anybody Porta Westfalica
I'll have a look at it asap, but unsure when that will be, so this is open to anyone for now...
- π©πͺGermany Anybody Porta Westfalica
The changes indeed don't seem to work. Maybe it's just not possible easily. Perhaps @grevil can have a short look, if he sees the reason, otherwise let's just leave this open for someone to resolve, who knows better...
- First commit to issue fork.
- π©πͺGermany Grevil
I wouldn't spend too much time on this, it is very uncommon for a ContentEntityType to have a machine name. Usually content entities don't have "machine_names", instead they use a simple id as their method of identification.
Meaning there won't be many examples in core.
EDIT: Fixed it.
The problem was pretty good described by the exception thrown, when the commented out part is commented in:LogicException: The machine name element "machine_name][widget][0][value" is defined before the source element "name",
We are trying to use the source of a field, which at that point in time doesn't exist. But it works now! Please review!
-
anybody β
committed 2761cf26 on 8.x-1.x
Issue #2978978 by anybody, grevil, bgilhome, lrwebks: Auto-fill machine...
-
anybody β
committed 2761cf26 on 8.x-1.x
- Status changed to Fixed
about 2 months ago 2:34pm 18 February 2025 Automatically closed - issue fixed for 2 weeks with no activity.