I had a look through the code for the module and wanted to suggest some minor changes which may provide benefits to the efficiency of the module.

I saw that there are a couple of sections in this module where a function has the Webform components available to it already but either calls _webform_conditional_get_all_components (which does a database lookup) or in the case of the webform_conditional_form_alter, just grabs them directly from the database.

Also instead of using a direct database call in _webform_conditional_get_all_components you could optionally call menu_get_object (http://api.drupal.org/api/drupal/includes!menu.inc/function/menu_get_obj...) which will return the node from memory which contains the webform including components.

I have included the patch which implements the first two changes. I was going to see what your thoughts are on the third change as I know you are making changes to the data there and not sure how that change would effect this.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

akoepke’s picture

FileSize
1.06 KB

Please ignore this patch - see revised below

akoepke’s picture

FileSize
1.73 KB

I have re-rolled the patch, there was one change I had forgotten to include (which makes the difference between it working and not working!)

densolis’s picture

Issue tags: ++patch

akoepke,

I am helping Tedbow with this module. I will download and attempt to test it. Either Tedbow or I will follow up.

Dennis

densolis’s picture

Assigned: Unassigned » densolis

akoepke,

I'm a newbie helping Tedbow and I'm not sure how to go about testing your patch. Can you supply some suggestions as to how this might be tested. I realize that I could setup a test webform with some conditional fields on it, test it to make sure it works, appply your patch, and make sure that it still works.

However, my concern is I'm not sure what your patch affects so I'm not quite sure what to test. I'm concerned that your patch affects condition B and I might only test condition A. Any suggestions will be greatly appreciated.

Dennis