Closed (fixed)
Project:
Webform Analysis
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
16 May 2020 at 17:46 UTC
Updated:
11 Oct 2024 at 08:19 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
sokru commentedNeeded this for POC, so I hacked the term name visible. This patch will cause fatal error if Entity select
webform_entity_selectuses something else than Taxonomy term as type of item.Comment #3
sokru commentedUsed
entityTypeManagerso it should in theory work with any entity type. Tested with taxonomy terms and content (node) entities.Comment #4
sokru commentedAnd the missing patch.
Comment #5
sokru commentedAnd the proper missing patch :)
Comment #6
sokru commentedComment #7
jshosseini commentedDear sokru!
Sorry for delayed response :( .
I tested #2 and #5. As you wrote, #2 caused fatal error. But #5 did not worked for me. So I still see term IDs instead of term names with #5.
Comment #8
dsrdigialltd commentedComment #9
sokru commented@dsrdigialltd thanks for update!
Should be written as
Comment #10
jshosseini commentedThanks for your kind help. But nothing changed in output. Term Ids still are shown instead of term labels.
Comment #11
mohit_aghera commentedAdding additional cases based on webform field type.
Let's see how it works for use cases.
Comment #12
chandeepkhosa commentedPatches in #5 & #8 also failed for me.
Thanks Mohit, I can confirm your patch in #11 fixes my problem, I am using the Entity Select component.
Before

After

Comment #13
nevergoneRe-rolled #11 patch with webform_entity_radios support.
Comment #14
llewellyn.dawson commentedComment #15
llewellyn.dawson commentedTested the patch and did not work as intended.
Returns no term fields.
Comment #16
batigolixComment #17
esthertempel commentedI tested both #11 patch and #13 patch on a Drupal 10.2 clean installation with webforms version 6.2.
What I noticed is that if you choose webform_entity_checkboxes, webform_entity_select and/or webform_entity_radios (this last one is added in patch #13) the label of the terms are correctly displayed.
However if you choose webform_term_select the values are empty, nothing is displayed.
And if you choose for instance webform_term_checkboxes (this element is not added in the patches) the ID is displayed instead of the label.
What I notices while debugging is that webform_term_select skips this part of the code:
Comment #18
batigolixHere is a new patch that also adds labels for Term select and Term checkbox elements.
Comment #19
batigolixHere is a new patch rerolled after the PHPCS fixes
Comment #20
ross.rvt commentedIt works proper
Comment #22
batigolix