Support » Plugin: Email Before Download » Contact Form 7 Update

  • Plugin Author mandsconsulting

    (@mandsconsulting)


    Hello all,

    Thank you for your patience as we get the new version of Email Before Download working for everyone.

    We have been reading the forums and pushing updates as fast as we can.

    Contact Form 7 has released a new version, v5.0 and with this new version they have changed some of the ways they process their form. So as it currently stands EBD will not serve inline links with the newest version of CF7.

    We are working on this issue now for the next update.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author mandsconsulting

    (@mandsconsulting)

    This update will be released in the next few minutes.

    Ninos

    (@ninos-ego)

    Hey there,
    still have the same problem with cf7 5.0 and before download 5.1 (all latest). Forms are currently wrong.

    I get following html-code directly after the form-tag:
    <p><label class="ebd_input"><input name="ebd_downloads[]" value="10729|Trends im Affiliate-Marketing 2018" type="hidden"></label></p>
    Before there was no p-tag, and so no line-break.

    Also following cf7-html:

    <p class="name-download">Ihr Name<br />
        [text your-name class:name-input id:name]</p>
    
    <p  class="email-download">Ihre E-Mail-Adresse*<br />
        [email* your-email class:email-input id:email]</p>
    
    <p class="submit-download">[submit "Download-Link anfordern" class:submit-pc]</p>

    will now be rendered to this:

    <p class="cf7_input" id="downloadinputform">Ihr Name<br><span class="wpcf7-form-control-wrap your-name"><input name="your-name" value="" size="40" class="wpcf7-form-control wpcf7-text name-input" id="name" aria-invalid="false" type="text"></span></p>
    <p class="cf7_input">Ihre E-Mail-Adresse*<br><span class="wpcf7-form-control-wrap your-email"><input name="your-email" value="" size="40" class="wpcf7-form-control wpcf7-text wpcf7-email wpcf7-validates-as-required wpcf7-validates-as-email email-input" id="email" aria-required="true" aria-invalid="false" type="email"></span></p>
    <p class="cf7_input"><input value="Senden" class="wpcf7-form-control wpcf7-submit" type="submit"><span class="ajax-loader"></span></p>

    As you can see, the p-classes are completely wrong.

    Hope you can fix it asap 🙂

    Ninos

    (@ninos-ego)

    BTW: Seems this bug is available since v5.0…

    Ninos

    (@ninos-ego)

    p-tag class can be fixed by changing /includes/class-email-before-download-form.php:42 from:
    $p->setAttribute('class', 'cf7_input');
    to
    $p->setAttribute('class', $p->getAttribute('class') . ' cf7_input');

    Plugin Author mandsconsulting

    (@mandsconsulting)

    @ninos-ego

    This will be resolved in the next update.

    Thanks for pointing it out.

    Ninos

    (@ninos-ego)

    @mandsconsulting I also recommend changing /includes/class-email-before-download-form.php:61 from:
    $paragraph->parentNode->insertBefore($item, $paragraph);
    to
    $paragraph->parentNode->appendChild($item);

    If possible I would change all insertBefore to appendChild.

    Reason:
    WP sometimes adds a p-tag around your hidden fields (e.g. when using page builders). So if p-tag is before name, email and submit-field you’ll mostly get styling errors. p-tag on the end will not destroy much as on beginning of the form-fields..

    Hey there,
    seems in the html-function you changed latest insertBefore() to appendChild(). Is it possible to do it with all insertBefore()-function in the html-function of the file /includes/class-email-before-download-form.php?
    So change:

    
    public function html()
        {
    
            $raw = do_shortcode("[contact-form-7 id=\"$this->form_id\" ]");
            $remove = array('<ebd />','<ebd/>','<ebd_left />','<ebd_left/>');
            $raw = str_replace($remove, "", $raw);
            $form = new DOMDocument;
            libxml_use_internal_errors(true);
            $form->formatOutput = true;
            $form->loadHTML(mb_convert_encoding($raw, 'HTML-ENTITIES', 'UTF-8'));
            $form->removeChild($form->doctype);
            $form->replaceChild($form->firstChild->firstChild->firstChild, $form->firstChild);
            $parent = $form->getElementsByTagName('form')->item(0);
            $formID = $parent->getAttribute('action');
            $tmp = explode('#', $formID);
            $this->atts['form_id'] = $tmp[1];
            $paragraph = $parent->getElementsByTagName('div')->item(0);
    
            foreach ($this->download_id as $key => $id) {
                if(count($this->download_id) == 1) {
                    $item = $this->hide_download_dom_obj($id, $key);
                }else{
                    $item = $this->download_dom_obj($id, $key);
                }
                $item = $form->importNode($item, true);
                $paragraph->parentNode->insertBefore($item, $paragraph);
            }
    
            foreach ($this->atts as $name => $value) {
                if($value){
                    $item = $this->hidden_dom_obj($name,$value);
                    $item = $form->importNode($item, true);
                    $paragraph->parentNode->insertBefore($item, $paragraph);
                }
            }
            if($this->atts['hide_form'] == 'yes'){
                $script = $this->jquery_dom_obj();
                $item = $form->importNode($script, true);
                $parent->appendChild($item);
            }
            libxml_clear_errors();
            return $form->saveHTML();
        }
    

    to

    
    public function html()
        {
    
            $raw = do_shortcode("[contact-form-7 id=\"$this->form_id\" ]");
            $remove = array('<ebd />','<ebd/>','<ebd_left />','<ebd_left/>');
            $raw = str_replace($remove, "", $raw);
            $form = new DOMDocument;
            libxml_use_internal_errors(true);
            $form->formatOutput = true;
            $form->loadHTML(mb_convert_encoding($raw, 'HTML-ENTITIES', 'UTF-8'));
            $form->removeChild($form->doctype);
            $form->replaceChild($form->firstChild->firstChild->firstChild, $form->firstChild);
            $parent = $form->getElementsByTagName('form')->item(0);
            $formID = $parent->getAttribute('action');
            $tmp = explode('#', $formID);
            $this->atts['form_id'] = $tmp[1];
            $paragraph = $parent->getElementsByTagName('div')->item(0);
    
            foreach ($this->download_id as $key => $id) {
                if(count($this->download_id) == 1) {
                    $item = $this->hide_download_dom_obj($id, $key);
                }else{
                    $item = $this->download_dom_obj($id, $key);
                }
                $item = $form->importNode($item, true);
                $paragraph->parentNode->appendChild($item);
            }
    
            foreach ($this->atts as $name => $value) {
                if($value){
                    $item = $this->hidden_dom_obj($name,$value);
                    $item = $form->importNode($item, true);
                    $paragraph->parentNode->appendChild($item);
                }
            }
            if($this->atts['hide_form'] == 'yes'){
                $script = $this->jquery_dom_obj();
                $item = $form->importNode($script, true);
                $parent->appendChild($item);
            }
            libxml_clear_errors();
            return $form->saveHTML();
        }
    

    I have lots of styling-errors because of insertBefore()..

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Contact Form 7 Update’ is closed to new replies.