Skip Navigation

[Resolved] Validation failed and deprecated type string

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 6 replies, has 3 voices.

Last updated by jacquesS-4 2 months, 1 week ago.

Assisted by: Christopher Amirian.

Author
Posts
#2745679

After adding a Toolset Form to a page, there was an error (in *1 below).
Strangely this now suddenly results from ALL other pages.
And even more weirdly, a debug exercise shows a QI block which we used in the primary multisite but never used in the secondary site -- because it caused clashes with Toolset.
So perhaps something buggy happened to the tables... who knows.

As my design of the form was interrupted so many times, I can't retrace my steps. Perhaps I made some stupid error.

If I could understand why this is the result, and where to fix this, that would be great.

The Error message:
* 1 Page error: Validation failed. Please, provide correct values for all fields.

There was in 2021 a similar ticket on Toolset at https://toolset.com/forums/topic/validation-failed-please-provide-correct-values-for-all-fields/
But although resolved, the solution was not given.

* 2 Debug message
Deprecated: parse_url(): Passing null to parameter #1 ($url) of type string is deprecated in .../wp-content/plugins/cred-frontend-editor/vendor/toolset/toolset-common/toolset-forms/classes/class.file.php on line 142
FROM line 142 the code is:

$file_path = parse_url( $value );
if ( $file_path && isset( $file_path['path'] ) ) {
$file = pathinfo( $file_path['path'] );
} else {
$file = pathinfo( $value );
}
if (
isset( $file['extension'] ) && in_array( strtolower( $file['extension'] ), array(
'jpg',
'jpeg',
'gif',
'png',
) )
) {
$preview = '<img alt="" src="' . $value . '" />';

#2745696

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

The error message you see in the editor "Validation failed. Please, provide correct values for all fields" indicates that you have a custom field group assigned to the type of post you are editing and that it includes required fields which have not been completed. So you cannot save the post until the required field values are provided.

The deprecation notice you shared could be related, but in any case as a deprecation notice it does not directly affect functionality. If we have specific steps to reproduce generating the notice then I can try to replicate it so we can look into it further.

#2745706

Thanks a lot Nigel.
Signed off for the day, will investigate further tomorrow.

I suspected "required fields which have not been completed" and did check quickly - couldn't find any; but will do microscopic check tomorrow.
But then - why would this effect ALL pages - even those to which the form have not been added.
Have a good weekend!

#2746659

Christopher Amirian
Supporter

Languages: English (English )

Hi,

It would help if we have steps to reproduce the problem, so that at least we can guess what might be on fault here.

With the current information there is not much to answer.

#2747150
Emergency-page-works.png

Hi
Thanks for your assistance.
We're still troubleshooting, trying to trace back all the activities we have done before the problem occurred.

Meanwhile:
If the problem results from a required field in a custom field group of a type of post, why does it happen in a static page which is not really part of any type.

We have an Emergencies page created with Toolset blocks (see screenshot of blocks used). It works fine - see hidden link

However when we try to edit that page (which was created quite some time ago and always worked) the Verification failed error occurs. Any editing is blocked for ALL pages.

We're experimenting with Forms and added a form only to one page, but now the entire site is affected.

Perhaps the problem is due to something else completely (we're still troubleshooting elsewhere).

Regards

#2747221

Christopher Amirian
Supporter

Languages: English (English )

Hi,

Please get back to us if you concluded with steps.

But I did a search and found this:

https://toolset.com/forums/topic/again-validation-failed-please-provide-correct-values-for-all-fields/#post-2737891

Which again talks about the fact that a custom field is assigned to a page where it is required.

You can test by checking all thecustom fields of your website and see which group is assigned where.

Thanks.

#2747766

Hi Christopher and Nigel
Thanks for your patience.

I didn't realize that Toolset becomes the "container" for all posts and pages on a site. What puzzled me was not really so much the form, but the fact that all pages (none of which has a form) became un-editable. So that must be because if a form applies to the group "pages" this is site-wide, and not only pages assigned to it.
I wrongly assumed that when a field group is assigned to Pages, one would then select from pages to which the group applies.

So this is sorted now.
Thanks again.