Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This is probably still relevant in Webform 4-dev.
Webform UI should check if a "pre-build options list" is selected, and if it is, load that list. Currently it only listens for onchange. My custom mod sets the default "pre-build options list" via #default_value, but that doesn't do anything: the Options textarea remains empty. I have to trigger the onchange in a custom JS.
Webform could check if the "pre-build options list" element has a value selected and if so load that value.
It's an edge case, I admit, but it's free.
Comment | File | Size | Author |
---|
Comments
Comment #1
Meliorate CreditAttribution: Meliorate commentedComment #2
rudiedirkx CreditAttribution: rudiedirkx commentedI don't think that's what I meant... Yours sounds like a bug. Mine is definitely not a bug and very probably an edge case.
If yours is a bug, create a new issue and please remove the text from comment # 1.
Comment #3
DanChadwick CreditAttribution: DanChadwick commented7.x-3.x is only receiving critical bug fixes. If this is still an issue in 7.x-4.x, please reopen and provide more detail and/or a patch.
Comment #4
rudiedirkx CreditAttribution: rudiedirkx commentedYou waited a year, to close it. Nice.
If you don't understand the problem, don't attach the patch and do this somewhere:
The Load a pre-built option list option will be selected, but the option list wasn't downloaded and pre-filled. Attached patch does that by always triggering the change event, which now also checks for None.
Comment #5
DanChadwick CreditAttribution: DanChadwick commentedThe first time I saw your issue was 7 hours ago ... as I spent my weekend weeding through 350 old, moldy, largely-abandoned issues. Care to help with some of them? I could sure use it.
Comment #6
rudiedirkx CreditAttribution: rudiedirkx commentedJust a few, if you don't mind =)
You can trust me and apply this patch without testing decently. That'll save a few minutes.
I'll browse the issue q, always exciting. Where do I start? The 3.x stuff?
Comment #7
DanChadwick CreditAttribution: DanChadwick commentedStart anywhere that interests you. Most 7.x-4.x issues have some validity and/or need some real work. Most 7.x-3.x issues can be closed. Some are duplicates or need linking to related issues.
Unless you want to be a maintainer, please close 7.x-3.x issues that don't relate to 7.x-4.x or 8.x. I don't have the time to commit them, and I won't commit them blindly. I you want to be a maintainer for 7.x-3.x, I totally support the idea.
Comment #8
rudiedirkx CreditAttribution: rudiedirkx commentedI don't want to be a maintainer. I will look into old 3.x issues (and leave the more relevant, current 4.x issues to you). The patch in #4 still needs your attention though. It's still 'broken' in 4.x.
Comment #9
DanChadwick CreditAttribution: DanChadwick commentedThank you for your efforts. When this issue bubbles up to the top of the queue (which it will by virtue of the activity) I will look at it. I haven't looked at all at the jQuery for select components, but on the surface, your patch seems logical.
Webform is huge. It is hard to be familiar with all aspects of it. :(
Comment #10
DanChadwick CreditAttribution: DanChadwick commentedI'm confused as to why your custom module doesn't both set #default value and the options list, rather than relying on JS to do it. Wouldn't that be cleaner? And it would work in the absence of JS.
Comment #11
DanChadwick CreditAttribution: DanChadwick commentedComment #12
rudiedirkx CreditAttribution: rudiedirkx commentedBecause way back when, there wasn't a clean way to get the options in custom code. In 4.x there is:
so it's all good!
It looks like there's a bug in the ajax part though... If I can reproduce, I'll create a new issue.
Comment #13
rudiedirkx CreditAttribution: rudiedirkx commentedEven simpler:
Comment #14
DanChadwick CreditAttribution: DanChadwick commentedExcellent! Thanks for your work on this.