- 🇺🇸United States greenSkin
Here's an alternate patch that moves the "isTitlePreserved()" check into the "autoLabelNeeded()" method and ignores preserving the title if the title is empty or is "%AutoEntityLabel%".
- Status changed to RTBC
over 1 year ago 11:37am 1 March 2023 - 🇮🇳India Meeni_Dhobale
Hello,
I reviewed the patch #21 and it's working fine for me. I also check with the other two options, Remove special characters and Re-save. This patch is working fine so issue can be move to RTBC. - Status changed to Needs work
over 1 year ago 5:59am 2 March 2023 Hi,
I am still experiencing the same issue as described in #6 and #7 so not sure if this should be RTC.
- Status changed to Needs review
over 1 year ago 1:04am 11 March 2023 - 🇺🇸United States greenSkin
Here's an update for patch from #21 that checks the entity ID is not empty when determining if generating the auto label is needed, i.e., if empty ID then auto label is not needed (don't auto-generate label).
- Status changed to Needs work
about 1 year ago 10:54am 28 March 2023 - 🇺🇸United States DamienMcKenna NH, USA
#24 seems to not work correctly on newly created entities when the "Automatically generate the label and hide the label field" option is set, it creates entities with empty labels. This can be seen by the tests failing.
- Status changed to Needs review
about 1 year ago 10:58am 28 March 2023 - 🇺🇸United States DamienMcKenna NH, USA
A variation of #24 that includes this change:
@@ -161,8 +161,7 @@ function auto_entitylabel_entity_presave(EntityInterface $entity) { $decorator = \Drupal::service('auto_entitylabel.entity_decorator'); /** @var \Drupal\auto_entitylabel\AutoEntityLabelManager $decorated_entity */ $decorated_entity = $decorator->decorate($entity); - if ($decorated_entity->hasLabel() && $decorated_entity->autoLabelNeeded() - && !$decorated_entity->isTitlePreserved()) { + if ($decorated_entity->autoLabelNeeded()) { $decorated_entity->setLabel(); } }
- Status changed to Needs work
about 1 year ago 2:18pm 28 March 2023 - 🇺🇸United States DamienMcKenna NH, USA
I opened 🐛 Generate+Hide option fails when Preserve Title option selected Needs review for a similar problem creating nodes when the "Preserve" option is enabled; it might ultimately be same bug, but I thought cleanly starting with test coverage would be a good approach.
- Status changed to Needs review
about 1 year ago 12:39pm 3 April 2023 - 🇺🇸United States DamienMcKenna NH, USA
I did not realize that setLabel() threw an exception if the entity didn't allow labels.
- Status changed to Needs work
8 months ago 6:19am 31 October 2023 - 🇦🇺Australia jannakha Brisbane!
- needs to pass tests
- the patch doesn't apply tokens, eg [node:nid] is not being added to the label if it's part of the auto label template - 🇩🇪Germany Anybody Porta Westfalica
I can also confirm this issue, resulting in "" when using that option
Please also note the remarkable work done by @DamienMcKenna in 🐛 Generate+Hide option fails when Preserve Title option selected Needs review regarding tests. Should we eventually combine the changes in one issue and MR?