Skip to content

Commit

Permalink
Merge pull request #777 from rob/fix-gf-error
Browse files Browse the repository at this point in the history
Fix Gravity Forms error when deleting forms / track when form trashed
  • Loading branch information
Luke Carbis committed Oct 6, 2015
2 parents d361865 + 9cccf97 commit 1d11e74
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions connectors/class-connector-gravityforms.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Connector_GravityForms extends Connector {
'gform_form_status_change',
'gform_form_reset_views',
'gform_before_delete_form',
'gform_form_trash',
'gform_post_form_trashed',
'gform_form_restore',
'gform_form_duplicate',
'gform_export_separator', // Export entries
Expand Down Expand Up @@ -722,7 +722,24 @@ public function callback_gform_update_is_starred( $lead_id, $status ) {
);
}

public function callback_gform_post_form_trashed( $id ) {
$form = $this->get_form( $id );

$this->log(
__( '"%s" form trashed', 'stream' ),
array(
'form_title' => $form['title'],
'form_id' => $id,
),
$form['id'],
'forms',
'trashed'
);
}

private function get_form( $form_id ) {
return reset( \GFFormsModel::get_forms_by_id( $form_id ) );
$form = \GFFormsModel::get_form_meta_by_id( $form_id );

return reset( $form );
}
}

0 comments on commit 1d11e74

Please sign in to comment.