Webform component clone (WFCC) is a webform module widget, it provides a copy across the different webform component. (FYI on the old thread http://drupal.org/node/298268)

If you have many different webforms, but some very similar to the webform component, then the module will be suitable for use, you can easy clone, modify component and save time.

http://drupal.org/sandbox/Hipfox/1562236
at this time, support 6.x. my first commit ;p

fyi http://drupal.org/node/298268

CommentFileSizeAuthor
#4 error_message.png155.65 KBiptechlabs
#4 correct_error_message.png81.46 KBiptechlabs

Comments

patrickd’s picture

welcome,

You got a wrong named branch '6.x' (see release naming conventions). Please remove it.

git push origin :6.x
git branch -d 6.x

Your project page looks a little short, please have a look at the tips for a great project page.

Also your code is not very well documented. Please document all your functiona, also more inline comments would be nice (it's always good if other developers are able to understand the code without actually reading the code).
Have a look at the coding and documentation standarts.

while waiting for an in-depht review of your module you can start out fixing some coding style issues detected by automated tools:
http://ventral.org/pareview/httpgitdrupalorgsandboxhipfox1562236git

We do really need more hands in the application queue and highly recommend to get a review bonus so we can come back to your application sooner.

regards

hipfox’s picture

Updated:

* Try to make a well document, and fixing some coding style.
* Removed the wrong branch '6.x'.
* Write more description for project page.

Done.

avpaderno’s picture

Priority: Normal » Critical
iptechlabs’s picture

StatusFileSize
new81.46 KB
new155.65 KB

Hi,

This module seems to me useful, but there is an error message that is shown randomly for a few seconds when I entered a not existing component then I click "Component clone", then the correcte error message appears.

hipfox’s picture

Hello,

I have reviewed the wfcc function, not sure how that happened.
Some reason maybe cause the error when using suspicious browser plug-ins, did you?

iptechlabs’s picture

Hello,

The error is generated for me in firefox browser.
I successfully reproduced the error when I click in the button "Component clone" before returning data JSON format (Loding data)
Suggestion: think to disable the button until the data are returned.

Replace "exixt" by "exist" in the wfcc.module file lign 117.

hipfox’s picture

iptechlabs,

Could you add "exit();" after "drupal_json($matches);" in your machine.
or replace "drupal_json($matches);" with

print drupal_to_js($matches);
exit();

to find helpful.

I found that way http://drupal.org/node/42552#comment-3578848.

iptechlabs’s picture

Priority: Critical » Normal
Status: Needs review » Needs work

Hello,

The problem is not in drupal_json() callback. You can reproduce it easily if you run the xdebug and you make a breakpoint in the beginning of wfcc_autocomplete_load() function than you enter a caracter. wfcc_autocomplete_load() function is called at this case and the xdebug is launched.
If you click on the button (when the xdebug is running and positioned on the beginning of the wfcc_autocomplete_load() function) the error message appears.

I suggest to disable the button while loading data (You can use a javascript code to disable the button)
This code solves the problem, but it's better to find another solution better than the one proposed:

1- Create a file .js and insert this code:

$(document).ready(function() {
  $('#edit-wfcc-history').keypress(function() {
        $("#edit-wfcc-add").attr("disabled", "disabled");
        setTimeout($("#edit-wfcc-add").removeAttr("disabled", "disabled"), 3000);
});
})

2- Include this file at the beginning of wfcc_form_alter () function

drupal_add_js(drupal_get_path('module', 'wfcc') . '/your_file.js');

alan d.’s picture

Hipfox, I'm more than happy for you to help with Webform Share. It is not a duplicate in relation to workflow / code but this would benefit greatly for this functionality (or vice versa).

Currently it handles Importing / Exporting / Resetting webforms in relation to an exported PHP code segment. The main reason I wrote it was to automatically populate a form based on a saved export in the content type settings.

i.e. Create node (webform) of type Job Application and hit save and bang the entire form is set up

hipfox’s picture

Alan D., Glad to hear your ideal, it would become better.

If possible, have you any further plans we can merge work? My idea is incorporated into the webform share.

alan d.’s picture

On closer inspection of the code, they are doing totally different things. However, if you want to try and fit this into webform share, I'm happy to review / help where possible.

I would recommend patches so that I can mentor things along. However, is Drupal 7 a better starting point?

hipfox’s picture

Drupal 7 is a good starting point, I will try to patch. If that is successful, the webform share for DR7 will have new features.
WFCC remain in drupal 6 version no longer for d7 version.

hipfox’s picture

Status: Needs work » Needs review

I have changed an autocomplete request and return data.

The problem is not with the autocomplete php routine. The error is occurring in the javascript (drupal.js ahahError). It happens when the submit button is selected before the ajax routine is finished. You can repeat it by starting the autocomplete process and submitting immediately. Normally, it happens so fast that the process completes before the form is submitted, but not always happen.

Also, I think this is a combination of bad server response, slow connection and large number of data entries to process.

Changlogs:
- Using drupal_to_js instead of drupal_json.
drupal_json uses drupal_set_header to print out some headers. Which could cause issues in some servers or somewhat reason such as an HTTP Error 0 pop-up in javascript.
- Convert the string to uppercase, which is consistent with the sql query syntax.
- Changed implements hook_form_webform_components_form_alter directly.

webdorado’s picture

Status: Needs review » Needs work

Some coding standards validations:

  1. wfcc.module - line 60 - now '#weight'=> -100 should be '#weight' => -100
  2. readme.txt - line 4 - the line must be no longer than 80 symbols
klausi’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. Feel free to reopen if you are still working on this application.

klausi’s picture

Issue summary: View changes

FYI on the old thread http://drupal.org/node/298268