Hello at all,
I make my first steps with conditional rules. So here is my problem:
I have a select list with
A|A
B|B
C|C

And 3 text fields D,E,F
I want to say: if select A, then D; If select B then E ...

The problem is: I can declare with is not, but no way to use is as statement. Everytime I save it show "is at" as result of the rule. When I use "is not" it works correctly. Does anybody has the same experience like me and a result perhaps???

Thx in advance

maen

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ShaneEaston’s picture

I'm getting the same thing on a brand new Drupal install with only webform installed.

quicksketch’s picture

I'm not able to reproduce this problem. It could be a browser problem. What browser are you guys using?

maen’s picture

I'm using latest firefox and google.

ericsv’s picture

I run into the same issue.

jami3z’s picture

same issue here. setting to "is" changes to "is at" when saved. FF + chrome.

Andy Dorman’s picture

I just switched to 7.x-4.0-alpha4 last week. We are big users of webform with webform_conditional in D6 and are bringing up our first D7 site.

This past weekend I added webform conditionals to our first D7 form. Within the form we need for several fieldsets containing additional fields to only open if an earlier "select options" on the same page 'is' a specific value.

What we observed when defining the conditionals was if you select "String-is" or "Select-is" and hit "Save conditions", it actually saves "Time-is at" for the condition. FWIW, we are aware "String-is" is not appropriate for a select list conditional...we were trying to discern a pattern to the failures.

Environment is PHP 5.4.4-4, D7.14, postgreSQL 9.1.4, FF and/or Chrome

quicksketch’s picture

Thanks Andy Dorman, any help debugging this issue would be great. I'm still not seeing the behavior myself. :\

Andy Dorman’s picture

Title: Selector in conditional rules jumps to "is at" » Selecting Any Field With value="equal" in conditional rules jumps to "Time - is at"

OK, I think I am beginning to see what is going on...

Our select options field is normally dynamically filled at run time. So I have a single place holder value to satisfy the form validation and add the select field.

When I populated the select field with several values in order to test it, I found that the webform_conditional form started showing the proper possible values.

quicksketch’s picture

@Andy Dorman, hmm is this a custom component or a select list populated via hook_webform_select_options_info()? Seems like what we need is a parameter to that hook that says, "give me back *all* possible results, so things like this conditional drop-down would always have the right result, as well as places where the options are needed, such as on the Results page and in CSV downloads.

Everyone else, is there anything special in your guys' forms beyond a stock installation of Webform? @ShaneEaston reported this happens on a stock install, but I haven't been able to reproduce it.

ramez.gaberiel’s picture

There is a similar issue going on and I answered how I was able to resolve this problem here:
http://drupal.org/node/1795820#comment-6756480

lefnire’s picture

@ramez.gaberiel - sure enough, clearing browser cache solved it for me. Strange issue...

quicksketch’s picture

Category: bug » support

So it sounds like this is a conflict between Webform Conditional and Webform when they're installed at the same time. Clearing all Drupal AND browser caches fixes the problem after Webform Conditionals has been disabled. Thanks @ramez.gaberiel for the information!

Moving this to a support request, since evidence so far doesn't indicate a bug in Webform.

quicksketch’s picture

Status: Active » Postponed (maintainer needs more info)

Marking postponed until more information becomes available.

quicksketch’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Please reopen if this problem can be reproduced.

bobfly’s picture

Having the same issue. No matter how many times I choose "IS" in the select choices, "IS AT" in the time choices is what is stored. No number of clear caches or even restarting the server has any effect. I am new to Drupal , but I have decades of development and database experience.

Running (acquia) Drupal 7.25 on Win7 without webform validator installed yet (but I assume 90%+ of people who want conditional will want validator as well). Once system is developed on my desktop will move to an actual Linux Apache server for production.

Currently working around the problem by using "is not"/"NO", but this means I need 3 conditions on each field where 1 would work if "is"/"YES" worked.

Additionally, I would like to see a way to have conditional control (ie show/hide) a list of fields with a single test. In other words, if I test for "yes sign me up" being selected, I want to display "name", "address", "city", "state", "zip", "phone", "sponsor" and "email" all at the same time without having to make 8 separate tests all for the same exact condition. Would make it a lot easier to avoid making a mistake.

René-Marc Simard’s picture

Version: 7.x-4.0-alpha4 » 7.x-4.0-rc3
Issue summary: View changes
Status: Closed (cannot reproduce) » Needs review
FileSize
592 bytes

I have this issue when a condition fails : all conditionals afterwards do not get updated by jQuery anymore. Since all "is" operators share the same "equal" value but in different option groups inside the select tag, and since all groups for a given condition are shown if not handled properly by jQuery, and since all "equal" values are marked "selected" then browsers will show the last selected option, in this case the option "is at" with value "equal" inside the "time" option group.

To reproduce this, simply try adding an "is" condition on a fieldset and placing it before a valid "is" condition. This fieldset condition isn't logical. The once valid condition that follows will then turn into "is at" and Firebug's console will output "TypeError: Drupal.settings.webform.conditionalValues.sources[source] is undefined".

Since I cannot guarantee that a user won't setup broken conditionals, a preventative fix in my case is this quick patch to webform-admin.js. It will check that the data_type exists before continuing.

Status: Needs review » Needs work

The last submitted patch, 16: webform-1713384.patch, failed testing.

René-Marc Simard’s picture

Status: Needs work » Needs review
FileSize
604 bytes

Re-rolling patch to code-base tip.

Status: Needs review » Needs work

The last submitted patch, 18: webform-1713384.patch, failed testing.

quicksketch’s picture

Category: Support request » Bug report

Thanks for debugging this and providing a sample use-case. Let's move this to a bug report to get it more attention. I'm not 100% sure of the solution provided, we might be able to come up with something better. But overall the problem is real and this makes it pretty clear.

DanChadwick’s picture

I am unsure whether the bug described in #16 is the source of the other problems, but it could be. The cause of the issue in #16 is that fieldsets are included in the source select list so that other components may be grouped under them. But fieldsets themselves cannot be used as a source.

There simply is no good way to disable a single select list item in Drupal 7. optgroups (which are used to display pagebreaks) cannot be used because they cannot be nested. The only other solution is to disable the fieldset in jQuery, which I'm not keen on.

I think the best solution is to NOT include fieldsets in the select list (when it is an invalid choice), but rather expand their names. So, for example,

OLD WAY:
name
address
-street
-city
-state
phone number

NEW WAY
name
address: street
address: city
address: state
phone number

I changed the way that options lists are created. In addition, I fixed a possible problem where pagebreaks with the same name would overwrite each other. I now append _2, _3, etc. as needed to generate a unique name.

webform_component_list is called in a number of situations. Most of these are used to generate indented lists of checkboxes, and these cases are unchanged. These are:

  1. Email, as a component for the destination.
  2. Email, as an e-mail, subject, from_address or from_name.
  3. Email, as a list of included components.
  4. Download, as a list of csv components
  5. Preview, as a list of components to be shown.
  6. Analysis.

The cases where the options are used to generate a pop-up select list are:

  1. Conditionals, as the list of source components. Fieldsets are now shown as a prefix, rather than a selectable option. Nested components are prefixed by their parent fieldset(s), rather than hyphens.
  2. Conditionals, as the list of target components. Fieldsets are now shown as a prefix, rather than a hyphen. Both fieldsets and pagebreaks may be selected. Option groups are used to show pages.
  3. Views definitions. Nested components are prefixed by their parent fieldset(s), rather than hyphens. Also, pagebreaks themselves maybe selected (new feature, but not terribly useful).

In addition, existing conditionals may already be defined using fieldsets as a source. Since the fieldset will no longer be in the source select list, any conditionals involving illegal source components (such as fieldsets) we be reset to the default, which is the first component, its first operator, and its first value (if any).

A release note needs to document this.

Patch forthcoming.

DanChadwick’s picture

Version: 7.x-4.0-rc3 » 7.x-4.x-dev
Component: User interface » Code
Status: Needs work » Fixed
FileSize
5.6 KB

Committed to 7.x-4.x and 8.x.

With some hesitancy, I am marking this issues as fixed. I still don't know whether the original poster's issue is the same issue as described above. If not, please re-open this issue, hopefully with some helpful information for reproducing the issue.

  • DanChadwick committed 5865811 on 7.x-4.x
    Issue #1713384 by DanChadwick: Fixed conditionals should not reference...
  • DanChadwick committed 33468a5 on 8.x-4.x
    Issue #1713384 by DanChadwick: Fixed conditionals should not reference...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

Max2505’s picture

I fear we need to reopen this issue, as problem occurs (again) with version 7.x-4.12.

I have a webform with a select containing 3 options (say element "num" containing options 1|1, 2|2 and 3|3) and 6 other selects (say A,B,C,D,E and F - options of those select don't really matter).
A and B should be shown when 1 is selected.
C and D should be shown when 2 is selected.
E and F should be shown when 3 is selected.

I can define the conditional rules where I choose e.g. if "num" "select - is" "1" then "A" "is" "shown" (similar for other rules). I also tried with "select - is not", but when I press save, it saves as "time - is at" (or "time - is not at" when I tried with "select - is not").

Anything I can do to help this debug?

Max2505’s picture

Status: Closed (fixed) » Active
Max2505’s picture

Status: Active » Closed (fixed)

Nevermind, seem related to another issue, now it's working again...