Skip to content

Commit

Permalink
Merge branch 'feature/2771' into feature/2766
Browse files Browse the repository at this point in the history
* feature/2771:
  fix bad package lock
  do not run cypress tests with Jest #2771
  #2771 run isolated unit tests in Travis
  Revert "record cypress test run in travis #2771"
  record cypress test run in travis #2771
  Prepare for cypress in CI #2771
  Minor code clean up for #2768
  Restore new form ID for cloned new forms

# Conflicts:
#	package-lock.json
  • Loading branch information
Josh Pollock committed Oct 19, 2018
2 parents d0a6192 + 7899a34 commit 3f2f791
Show file tree
Hide file tree
Showing 11 changed files with 3,376 additions and 24,080 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ includes/freemius/assets/img/caldera-forms.png
bin/caldera-forms

wordpress/*
wp-content/*
wp-content/*
cypress/screenshots/*
cypress/videos/*
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ script:
- |
if [[ ! -z "$WP_VERSION" ]] ; then
phpunit
composer test:unit
fi
- |
if [[ "$WP_TRAVISCI" == "phpcs" ]] ; then
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ The local server is [http://localhost:8228](http://localhost:8228)
* `composer wp:setup-tests` - Adds test forms and puts them on pages.
* `npm test` - Run JavaScript test watcher
* `npm run test:once` - Run JavaScript unit tests once

* `npm run test:e2e` - Start Cypress e2e test runner.
* `npm run test:e2e:ci` - Trigger Cypress.io test record.
### Release To WordPress.org
##### Requires
* [svn](https://subversion.apache.org/quick-start#installing-the-client)
Expand Down
5 changes: 3 additions & 2 deletions classes/forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -570,11 +570,12 @@ public static function create_form( $newform ){
// get form templates (PROBABLY NEED TO MOVE METHOD INTO THIS CLASS)
$form_templates = Caldera_Forms_Admin::internal_form_templates();

$original_function_args = $newform;
$original_function_args = $newform;

if(!empty($newform['clone'])){
$clone = $newform['clone'];
}

// load template if any
if( !empty( $newform['template'] ) ){
if( isset( $form_templates[ $newform['template'] ] ) && !empty( $form_templates[ $newform['template'] ]['template'] ) ){
Expand Down Expand Up @@ -618,14 +619,14 @@ public static function create_form( $newform ){
*/
$newform = apply_filters( 'caldera_forms_create_form', $newform);


self::update_registry( $id );

if(!empty($clone)){
$clone_form = self::get_form( $clone );
if(!empty($clone_form['ID']) && $clone == $clone_form['ID']){
$newform = array_merge($clone_form, $original_function_args);
unset( $newform[ 'db_id' ] );
$newform[ 'ID' ] = $id;
}
}

Expand Down
Loading

0 comments on commit 3f2f791

Please sign in to comment.