support5d
Forum Replies Created
-
Forum: Plugins
In reply to: [Jobs for WordPress] Multi File Upload and restricted filetypesHey Stefan,
ich hab in einem anderem Projekt eine API an die Formulare angebunden und prinzipiell k?nnte man mit mit diesem Hook sich einklinken und prüfen was für Dateien übermittelt worden sind. Bevor das Plugin überhaupt etwas davon mitbekommt, ist aber jetzt kein fertiger Code aber ein Entwickler wei? was zu machen w?re.
Unsere Kunden haben da bisher noch nicht so das Spam Problem gehabt, daher hab ich es noch nicht für n?tig gehalten aktiv einzugreifen.
Grü?e
Dannyadd_action( 'wp_ajax_nopriv_jobslisting_apply_now', 'job_entry_store_tmp_files', 9); add_action( 'wp_ajax_jobslisting_apply_now', 'job_entry_store_tmp_files', 9); function job_entry_store_tmp_files(){ $allowed_file_types = array( 'png' => 'image/png', 'jpe' => 'image/jpeg', 'jpeg' => 'image/jpeg', 'jpg' => 'image/jpeg', 'gif' => 'image/gif', 'tiff' => 'image/tiff', 'tif' => 'image/tiff', 'pdf' => 'application/pdf', 'xlsx' => 'application/vnd.ms-excel', 'docx' => 'application/msword', ); // Check for files extension and throw error for form foreach($_FILES as $key => &$file){ // Grab MIME type $mime_type = mime_content_type($file['tmp_name']); if (! in_array($mime_type, $allowed_file_types)) { // File type is NOT allowed. // Throw Error msg for the the form } } }
@harthur90 did not help, it is more a problem in the hubspot form js script. It adds all missing form container… just try and remove the div container, the js script adds a fall back div container and renders the form in it
<div class="hbspt-form" id="hbspt-form-' . $form_div_uuid . '"></div>
- This reply was modified 2 years, 8 months ago by support5d.
Hey @harthur90 i could pinpoint the problem… we have 2 popups with hubspot shortcode forms in it… these are rendered & added invisible on all page loads
so the other 2 shown forms are different ones… the problem should not be the shortcode rendering but more a javascript problem, cause the 2 other divs are invisible
press the “Contact us” Button in the footer and it renders correctly a fourth form… which is the same code like the first duplicate one. Both duplicate forms are not using the $form_div_uuid as the javascript target.. so it is probably a javascript form rendering fallback when the html target is not found…
Wrong: hbspt-form-e0fdeb79-f0af-48a3-9455-d9c033003a5a (UUID from the id)
Wrong: hbspt-form-a4601138-f5a3-4ce7-b438-7c47f443db96 (UUID from the id)
Correct: hbspt-form-1656346333000-2111172195 (using the numeric $form_div_uuid)i created a small quick fix to hide the wrong forms, until the bug is somehow fixed or the plugin is updated. it replaces the return code in line 176 and IS NOT A PERMANENT FIX it adds a div container around the shortcode and hides all .hbspt-form besided the orignal one, which has the class .this_is_the_correct_form
return <div class="hide_duplicate_forms_inside_this_div"> <style> .hide_duplicate_forms_inside_this_div .hbspt-form { display: none; } .hide_duplicate_forms_inside_this_div .this_is_the_correct_form{ display: block !important; } </style> <script> window.hsFormsOnReady = window.hsFormsOnReady || []; window.hsFormsOnReady.push(()=>{ hbspt.forms.create({ portalId: ' . $portal_id . ', formId: "' . $id . '", target: "#hbspt-form-' . $form_div_uuid . '", region: "' . $hublet . '", ' . LeadinFilters::get_leadin_forms_payload() . ' })}); console.log("type: ' . $type . '"); console.log("portal_id: ' . $portal_id . '"); console.log("id: ' . $id . '"); console.log("form_div_uuid: ' . $form_div_uuid . '"); </script> <div class="hbspt-form this_is_the_correct_form" id="hbspt-form-' . $form_div_uuid . '"></div></div>';
PS: I found another customer with the same bug… there is single elementor popup in the background so there are only 2 forms printed not 3
https://www.gqs-akademie.com/download-schulungskatalog/- This reply was modified 2 years, 8 months ago by support5d.
- This reply was modified 2 years, 8 months ago by support5d.
- This reply was modified 2 years, 8 months ago by support5d.
- This reply was modified 2 years, 8 months ago by support5d.
- This reply was modified 2 years, 8 months ago by support5d.
- This reply was modified 2 years, 8 months ago by support5d.
- This reply was modified 2 years, 8 months ago by support5d.
Hey @harthur90 i addded the code and a var_dump before the switch clause… the var_dump was only posted on the first form and not repeatedly
i removed line 27 and the raw shortcode was only printed once
i added a console.log() in line 190 and it printed 3 times the form_div_uuid (the console.log() is still enabled for debugging)
i played around with echo, ob_start() + return ob_get_clean()… nothing seems to work…
(oh as a side note, on friday it only showed 2 forms… now there are 3 printed… black magic…)
- This reply was modified 2 years, 8 months ago by support5d.
Greetings, we are having the same problem, since last friday i think. All Plugins are up-to-date and the only solution is to replace all shortcodes with the javascript widget code.
As a side note, inside elementor the short code preview works fine and only one form is printed. The javascript embedded code works also fine
We tried every possible solution…