Hi Christian,
I did several tests before writing to you, let's talk about the "add content" module.
the choice of Taxonomies is ok, but something strange happens.
if I do not choose the Taxonomy (I tried to generate an error to see the operation) it happens that the image of the post increases in size, goes from miniature (150x150px) to medium size (300x300px).
I tried to select taxonomies and generate a different error by not inserting the post title and the image does NOT change in size.
It works out in my opinion, establishing the size of the image in the shortcode of the Cred module.
here is the shortcode part of the form:
<div class="form-group">
<label>[wpml-string context='cred-form-aggiungi creatura originale-348' name='foto']foto[/wpml-string]</label>
[cred_field field='_featured_image' value='' urlparam='' output='bootstrap']
</div>
I can replicate the same behavior with any backend validation, so I do not think this is specific to the taxonomy validation we added. For example, add this custom cred_form_validate function and the same image resize behavior can be seen:
add_filter('cred_form_validate','func_validate_taxonomy_select',10,2);
function func_validate_taxonomy_select($error_fields, $form_data)
{
//field data are field values and errors
list($fields,$errors)=$error_fields;
//validate if specific form
if ($form_data['id']==348 or $form_data['id']==349)
{
$errors['_featured_image'] = 'Some test error';
}
//return result
return array($fields,$errors);
}
I'm not sure if this is a bug, or the intended behavior. Let me reach out to my 2nd tier supporters for some clarification here, and I will update you when I have some new information to share.
Just a quick update to let you know we have reported the issue to our developers as a potential bug. Please stand by and I will update you as soon as I have some additional information. In the meantime the image upload and save process does not appear to be broken, just the display of the image when cred_form_validate returns some error.
I have some custom CSS you can add to the CRED form to prevent this image resize:
.js-wpt-credfile-preview img {
max-width: 150px;
}
Please add this CSS and let me know if the issue is not resolved.
Hi, just a quick update to let you know the upcoming release of Forms 2.5.7 will include a fix for this issue and the custom CSS code here should no longer be necessary.
Please note that Forms 2.5.7 has been released and the CSS override should no longer be needed. Please let me know if the problem is not completely resolved after updating to the latest versions of all Toolset plugins.