Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
Wpct ERP Forms
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
codeccoop
WordPress
plugins
Wpct ERP Forms
Commits
1dd989ee
Commit
1dd989ee
authored
8 months ago
by
Lucas García
Browse files
Options
Downloads
Patches
Plain Diff
feat: submission error handling
parent
97fa2a06
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!3
Git submodules
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
includes/class-integration.php
+5
-4
5 additions, 4 deletions
includes/class-integration.php
wpct-http-bridge
+1
-1
1 addition, 1 deletion
wpct-http-bridge
with
6 additions
and
5 deletions
includes/class-integration.php
+
5
−
4
View file @
1dd989ee
...
...
@@ -52,7 +52,7 @@ abstract class Integration extends Singleton
$response
=
Wpct_Http_Client
::
post_multipart
(
$url
,
$data
,
$uploads
);
}
$success
=
$success
&&
(
bool
)
$response
;
$success
=
$success
&&
!
is_wp_error
(
$response
)
;
}
}
...
...
@@ -65,8 +65,9 @@ abstract class Integration extends Singleton
$to
=
$email
;
$subject
=
'Wpct ERP Forms Error'
;
$body
=
"Form ID:
{
$form_data
[
'id'
]
}
\n
"
;
$body
.
=
"Form title:
{
$form_data
[
'title'
]
}
"
;
$body
.
=
'Submission: '
.
print_r
(
$payload
,
true
);
$body
.
=
"Form title:
{
$form_data
[
'title'
]
}
\n
"
;
$body
.
=
'Submission: '
.
print_r
(
$payload
,
true
)
.
"
\n
"
;
$body
.
=
'Error: '
.
print_r
(
$response
->
get_error_data
(),
true
)
.
"
\n
"
;
$success
=
wp_mail
(
$to
,
$subject
,
$body
);
if
(
!
$success
)
{
throw
new
Exception
(
'Error while submitting form '
.
$form_data
[
'id'
]);
...
...
@@ -203,7 +204,7 @@ abstract class Integration extends Singleton
]);
$res
=
Wpct_Http_Client
::
post
(
$url
,
$payload
);
if
(
!
$res
)
{
if
(
is_wp_error
(
$res
)
)
{
throw
new
Exception
(
'Error while establish RPC session'
);
}
...
...
This diff is collapsed.
Click to expand it.
wpct-http-bridge
@
a94c92d2
Compare
98b6d9e3
...
a94c92d2
Subproject commit
98b6d9e37
29
e
f6
1c1c7fafd73e23f793633d206
2
Subproject commit
a94c92d
29
d
f6
045583191097ba3fd5191636cac
2
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment