antonv
Forum Replies Created
-
Forum: Plugins
In reply to: [Post My CF7 Form] How to trigger a page refreah after saveThe suggested method using
wpcf7submit
failed, did not trigger a page reload. However, after hard coding an element id into the save button I added following script at the end of the post:document.getElementById("get-ref").onclick = function() {setTimeout(function(){ location.reload()}, 500);};
and that works well. The setTimeout is important without it the other scripts to process the form are abandoned.
Forum: Plugins
In reply to: [Post My CF7 Form] ID attribute ignored by [save]Thank you, hard coding did the trick.
Forum: Plugins
In reply to: [Post My CF7 Form] Problem with W3 Total CacheI could not reproduce the problem with W3 Total Cache on a separate site using the same host, same WP 6.01, PHP 8.1 etc but using minimal forms without hooking to custom code.
I used the default settings that W3TC starts up with after installment.
I then reloaded the W3 Total Cache on the production site, and got these console messages:
XHR GET https://example.org/wp-json/contact-form-7/v1/contact-forms/117/refill [HTTP/1.1 401 Unauthorized 767ms] Response { type: "basic", url: "https://example.org/wp-json/contact-form-7/v1/contact-forms/117/refill", redirected: false, status: 401, ok: false, statusText: "Unauthorized", headers: Headers(15), body: ReadableStream, bodyUsed: false } 4ea64.js:1:5256 T he resource at “https://example.org/wp-content/plugins/w3-total-cache/pub/js/lazyload.min.js” preloaded with link preload was not used within a few seconds. Make sure all attributes of the preload tag are set correctly.
I then compared the W3TC settings from the test site with those of the production site, they all matched.
Now here is the perplexing part, at the bottom of each setup page, I pressed [Save All Settings] even though I changed nothing. Having done that on the Minify Tab of W3TC the problem resolved and it is now all working.
No wonder my hair is greying at a rapid pace ??
Forum: Plugins
In reply to: [Post My CF7 Form] Problem with W3 Total CacheI will test this on a test site and not on my production site which now uses WP Fastest Cache
Will report back in a couple of days
Forum: Plugins
In reply to: [Post My CF7 Form] Media uploads saved to draft, but missing at later visitAs the user on subsequent visits has no confirmation that the uploaded file was accepted he/she is going to attach the file again, and must do so if the requirement is set by
[file* ...]
In the meantime I solved the problem by
add_action('cf7_2_post_form_mapped_to_page', 'saved_new_post_mapped',10,3); function saved_new_post_mapped($post_id, $cf7_form_data, $cf7form_key){ if ('new-article-form'==$cf7form_key) { if(isset($cf7_form_data['save_cf7_2_post']) && 'true'==$cf7_form_data['save_cf7_2_post']){ $attachments = get_attached_media( '', $post_id ); foreach ($attachments as $attachment) { wp_delete_attachment( $attachment->ID, 'true' ); } } } }
Here with this action the previous uploaded media is immediately deleted if the form is saved to draft.
Again, I must praise you for well documented source code allowing me to extract the relevant code and hooks.
Forum: Plugins
In reply to: [Post My CF7 Form] CF7 V5.6.2 breaks contact form required validationMy forms are saving correctly now. It was on the very first test with beta2 it did not save, on all subsequent tests with beta3 it saved OK.
It is only while the save button is pressed down that the required messages are displayed, on release they disappear an the form is saved.
I checked with
CF7 Smart Grid Design Extension 4.13
and it does exactly the same.I consider this as a minor beauty issue and not a bug
Forum: Plugins
In reply to: [Post My CF7 Form] CF7 V5.6.2 breaks contact form required validationPS above with
Contactform7 5.6.3
Forum: Plugins
In reply to: [Post My CF7 Form] CF7 V5.6.2 breaks contact form required validationI tested version of
CF7 Smart Grid Design Extension 4.14.0beta3
on a very complicated form that makes use of nearly all functions provided byPost My CF7 Form
together with numerous custom hooks and actions and it is working fine.Thanks for your efforts!
Now also works fine for me, and cannot reproduce it in beta 2.
However, what I observe now is while the save button is pressed is that the “please fill out this field” message is displayed in one field and then cleared on the save button release. I do not know if this is general or particular to my very complicated form with lots of custom code hooked into it. I will change some priorities of my hooks and actions. I will observe this some more before raising it in Post My CF7 Form support forum
I also found another issue: The
Post My CF7 Form
save function does not work as it now also does a required field validation.Confirming
v14.4beta2
working as intended ??OK, on a virgin WP installation I found that
A.
CF7 Smart Grid Design Extension
on its own works now checks all required fields before sendingA.
CF7 Smart Grid Design Extension
together withPost My CF7 Form
produces the double vision as per above link. Validation is correct and the form is sent. Therefore 6. of previous reply you can ignore.Disastrous, I followed these steps:
1. deactivatedPost My CF7
Form andCF7 Smart Grid Design Extension
2. deletedCF7 Smart Grid Design Extension
3. uploaded from wordpress admin the beta release, failed first time as server does not accept file larger than 2M. Had to change php.ini in cPanel.
4. activatedCF7 Smart Grid Design Extension
followed byPost My CF7
5. Now when I open the contact control panel, I see double.
- https://iow.onl/double.png
6. Yes validation works, but cannot send.
There was an error trying to send your message. Please try again later.
I will repeat this process on a fresh installationThanks for that info
However, I looked at the code and there is an easy fix by adding the function
addslashes
to the post_title as you did with the topic_content earlier in the code. Below lines 484 to 495 of index.php$topic_content = str_replace( array_keys($shortcodes), array_values($shortcodes), $topic_content ); $topic_content = apply_filters( 'bbppt_topic_content', addslashes( $topic_content ), $post->ID ); $new_topic_data = array( 'post_parent' => (int)$topic_forum, 'post_author' => $post->post_author, 'post_content' => $topic_content, 'post_title' => addslashes($post->post_title), // added addslashes 'post_date' => $post->post_date, 'post_date_gmt' => $post->post_date_gmt, 'post_name' => $post->post_name );
This should have no objections from the plugin moderators, in my opinion.