Events Made Easy Forums Bug fixed or feature request implemented Emtpy lines before booking form

Viewing 16 posts - 1 through 16 (of 16 total)
  • Author
    Posts
  • #62668
    arjan_b
    Participant

    Hi Franky,

    I have searched the forums about this issue and found two other entries about empty lines being shown in an event page, just above the booking form.

    When I look in the html source code of the event page, it shows this:

    <div id='div_eme-rsvp-form-60be9ade8483b'>
    <form id='60be9ade8483b' name='eme-rsvp-form' method='post' action='#' ><input type="hidden" id="eme_frontend_nonce" name="eme_frontend_nonce" value="2d4f684ccb" /><span id='honeypot_check'><input type='text' name='honeypot_check' value='' autocomplete='off' /></span><br />
    	   <input type='hidden' name='eme_is_multibooking' value='0' /><br />
    	   <input type='hidden' name='eme_multibooking_tpl_id' value='0' /><br />
    	   <input type='hidden' name='eme_register_empty_seats' value='0' /><br />
    	   <input type='hidden' name='only_if_not_registered' value='0' /><input type='hidden' name='person_id' value='' /><input type='hidden' name='eme_event_ids&#091;&#093;' value='34' /></p>
    <h3 style="font-family: 'Nanum Brush Script';font-weight: 900">Reserveer nu jouw plaats(en) voor deze workshop</h3>
    <div class="bt_bb_headline_subheadline">Nog 14 plaatsen beschikbaar voor 24 juli 2021.</div>
    <p> </p>
    <table class='eme-rsvp-form'>

    Notice the four <br /> tags in there? As was suggested in the other forum entries, I double checked my template, double checked my form and extra html headers, just to see that I had no blank spaces or even plain br tags in there.

    After some trying and not being able to change things, I decided to look at the code of eme_rsvp.php. At line 120 till 124 I found the place where this html code was parsed.

    The original code there:

    $form_html .= "<span id='honeypot_check'><input type='text' name='honeypot_check' value='' autocomplete='off' /></span>
    	   <input type='hidden' name='eme_is_multibooking' value='$is_multibooking' />
    	   <input type='hidden' name='eme_multibooking_tpl_id' value='$template_id_entry' />
    	   <input type='hidden' name='eme_register_empty_seats' value='$eme_register_empty_seats' />
    	   <input type='hidden' name='only_if_not_registered' value='$only_if_not_registered' />";

    To what I changed it in my file:
    $form_html .= "<span id='honeypot_check'><input type='text' name='honeypot_check' value='' autocomplete='off'></span><input type='hidden' name='eme_is_multibooking' value='$is_multibooking'> <input type='hidden' name='eme_multibooking_tpl_id' value='$template_id_entry'><input type='hidden' name='eme_register_empty_seats' value='$eme_register_empty_seats'><input type='hidden' name='only_if_not_registered' value='$only_if_not_registered'>";

    In short: I deleted the line breaks and put those separate input-tags back-to-back instead of on separate lines. After saving and uploading the file, the issue of having those unwanted BR-tags was gone.

    I suspect that the php-code builds up the full page, then does the line scan / add-BR scan (is that through eme_nl2br_save_html or similar?), and then outputs the info to the screen. But the line breaks that force the BR-tag to be added are in the code so the user cannot correct that!

    Could you please verify this for a future release?

    N.B. One other thing I noticed and first thought to be causing the issue; as I know that ending a html tag with /> is mandatory for some tags in HTML5, the INPUT-tag is not one of them as that is a solitude tag, even in HTML5. So that could be removed as it does nothing. But doesn’t do harm either.

    #62669
    Franky
    Keymaster

    Thanks for the bug report. Although it is weird the br-tags appear, the form is (from a quick glance) not ran through the nl2br function. Maybe it is again a wp issue that adds unwanted br-tags. But I’ll check/test on my end today too.

    #62670
    Franky
    Keymaster

    I just took a quick look at one of the sites I manage ( https://www.bonheidensehondenvrienden.be/events/gehoorzaamheidsles-juniors-2/ ) and that has no unwanted br-tags present.
    Do you define/use the filter eme_add_booking_form_filter ?
    And I do see a weird closing p-tag before you h3-tag. Is that added by you? Also an empty p+closing p at the bottom of your example.

    #62673
    arjan_b
    Participant

    it seems I cannot reply to this thread? It doesnt post my reply, and when I retry it said “Error: Duplicate reply detected; it looks as though you’ve already said that.”

    I will cut the reply in parts.

    #62674
    arjan_b
    Participant

    In the Instellingen > RSVP > Boeking Formulier opmaak I have this code:

    <h3 style="font-family: 'Nanum Brush Script';font-weight: 900">Reserveer nu jouw plaats(en) voor deze workshop</h3>
    <div class="bt_bb_headline_subheadline">Nog #_AVAILABLESEATS plaatsen beschikbaar voor #_STARTDATE.</div>
    <p>&nbsp;</p>
    <table class='eme-rsvp-form'>
                <tr><th scope='row'>Evenementdatum:</th><td>#_STARTDATE      (<a href="#data">andere datum kiezen?</a>)</td></tr>
                <tr><th scope='row'>Voornaam (verplicht):</th><td>#REQ_FIRSTNAME</td></tr>
                <tr><th scope='row'>Achternaam (verplicht):</th><td>#_LASTNAME</td></tr>
                <tr><th scope='row'>E-Mail (verplicht):</th><td>#_EMAIL</td></tr>
                <tr><th scope='row'>Telefoonnummer:</th><td>#_PHONE</td></tr>
                <tr><th scope='row'>Aantal plaatsen (verplicht):</th><td>#_SEATS</td></tr>
                <tr><th scope='row'>Evt. opmerkingen:</th><td>#_COMMENT</td></tr>
                </table>
                #_SUBMIT
    #62675
    arjan_b
    Participant

    That opening and closing P-tag just before the form, makes that there is some space between the header and the form. Originally the entered code is

    <p>&nbsp;</p>

    but when the settings are saved, it saves like this. Although needed for the end result (layout) I have experimented without this tag, it has no other impact than deleting only this from the page source and (thus) impacting the layout.

    #62677
    arjan_b
    Participant

    Where this closing P-tag (just after the hidden field only_if_not_registered) comes from, is unclear to me. That is not from entered code or layout in my setup anywhere. It is also in the middle of the form that is built by the php-code itself so I don’t expect it that it’s something from the setup options. To double check this, I have copied the html page source from the browser back to phpstorm editor, and it says closing tag matches nothing; in other words, this closing tag shouldn’t be there and there is no matching open P-tag somewhere else on the page. So this seems a bit random? And even more since it is the only place on the page that this happens? It doesn’t matter much as it doesn’t give any output, but still.

    PS the page is public and located at https://www.staopcoaching.nl/events/werken-aan-een-gezonde-leefstijl

    I have unedited the php-file, so you can see the result including the unwanted 4 lines above the form.

    I am not aware of using eme_add_booking_form_filter somehwere. The only eme code in my event template to show this form is #_ADDBOOKINGFORM. Do you need me to check something for this?

    #62678
    Franky
    Keymaster

    I’ll check your page too (and search for a rogue closing p-tag).
    But I already changed the code a bit:
    http://plugins.trac.wordpress.org/changeset/2544194

    I also checked on another site (using EME) and they don’t have the br-tags either …

    #62679
    arjan_b
    Participant

    My expectation is that one of the other plugins (or maybe even the template) scans and modifies before outputting the page and makes nl2br alike changes. And as the current EME output had some line endings, that may cause this. So I guess on most pages, this issue would not come up.

    I have implemented the change you made in your changeset to eme_rsvp.php just to test it, and this seems to solve my problem indeed.

    Something I was thinking: at line 364-367 in eme_rsvp.php there is a similar form_html build-up:
    $form_html .= "<div id='eme-cancel-bookings-message-ok-$form_id' (etc.)
    Should this then be changed perhaps as well (I don’t use this at the moment, but for the code uniformity).

    One last thing I noticed: in my html page source, I noticed:

    <input type='hidden' name='eme_event_ids[]' value='34' />

    The brackets are converted to html equivalents. Does this matter? So far, everything seems to run ok in EME.

    Thanks for your help already so far, much appreciated!

    #62680
    Franky
    Keymaster

    Concerning 364-367: indeed, I’ll change those too.
    I see also closing p-tags after each of the form fields in your html, so indeed some plugin must be changing the html layout. I’m curious to see which one … (maybe your theme even).
    I see indeed on your form that the brackets were changed to their html equivalent, but not on my other sites. I’m guessing this is also a side-effect linked to the br/p tags we see here.

    #62681
    Franky
    Keymaster

    Btw, you can install the plugin “Health Check & Troubleshooting”, which then allows you to (for your session only) disable plugins/change theme etc … so you can see what causes the issue without affecting your main site. Based on what I see in the source, you use the celeste theme and the “bold page builder”, so maybe you should check with the theme reseller/dev too.
    And more: I’m always interested in extra development aid, so ….

    #62683
    arjan_b
    Participant

    Very nice, thanks for the suggestion. I didn’t know about this plugin, but will certainly look into this as this might come in handy some time in future with developing WP sites.

    About the extra development aid: just contact me by e-mail in Dutch or English, both are fine 🙂

    PS. I have tweaked a bit more this evening and this is working well now. Thanks again!

    #62684
    Franky
    Keymaster

    Does that mean you figured out where the closing p-tags came from? And the other issues (the br-tags, the ‘[]’ being converted to html-equivalent)?

    #62685
    arjan_b
    Participant

    Not yet, but the forms and pages seem to work well with these issues in it. This was my main goal for tonight, as the attached action already went public through advertisement 🙂

    #62686
    Franky
    Keymaster

    Well, the dev-version contains the fixes too already (and then some). But no code adds rogue closing p-tags nor converts the ‘[]’ to html equivalents, so I’m guessing the theme is the culprit here. Feel free to send it to me for testing (mail of course), I’ll be sure to delete the theme after my test (since it is a paying theme).

    #62672
    arjan_b
    Participant

    In the Instellingen > RSVP > Boeking Formulier opmaak I have this code:

    <h3 style="font-family: 'Nanum Brush Script';font-weight: 900">Reserveer nu jouw plaats(en) voor deze workshop</h3>
    <div class="bt_bb_headline_subheadline">Nog #_AVAILABLESEATS plaatsen beschikbaar voor #_STARTDATE.</div>
     
    
    <table class='eme-rsvp-form'>
                <tr><th scope='row'>Evenementdatum:</th><td>#_STARTDATE      (<a href="#data">andere datum kiezen?</a>)</td></tr>
                <tr><th scope='row'>Voornaam (verplicht):</th><td>#REQ_FIRSTNAME</td></tr>
                <tr><th scope='row'>Achternaam (verplicht):</th><td>#_LASTNAME</td></tr>
                <tr><th scope='row'>E-Mail (verplicht):</th><td>#_EMAIL</td></tr>
                <tr><th scope='row'>Telefoonnummer:</th><td>#_PHONE</td></tr>
                <tr><th scope='row'>Aantal plaatsen (verplicht):</th><td>#_SEATS</td></tr>
                <tr><th scope='row'>Evt. opmerkingen:</th><td>#_COMMENT</td></tr>
                </table>
                #_SUBMIT

    That opening and closing P-tag just before the form, makes that there is some space between the header and the form. Originally the entered code is
    <p>&nbsp;<p>
    but when the settings are saved, it saves like this. Although needed for the end result (layout) I have experimented without this tag, it has no other impact than deleting only this from the page source and (thus) impacting the layout.

    Where this closing P-tag (just after the hidden field only_if_not_registered) comes from, is unclear to me. That is not from entered code or layout in my setup anywhere. It is also in the middle of the form that is built by the php-code itself so I don’t expect it that it’s something from the setup options. To double check this, I have copied the html page source from the browser back to phpstorm editor, and it says closing tag matches nothing; in other words, this closing tag shouldn’t be there and there is no matching open P-tag somewhere else on the page. So this seems a bit random? And even more since it is the only place on the page that this happens? It doesn’t matter much as it doesn’t give any output, but still.

    PS the page is public and located at https://www.staopcoaching.nl/events/werken-aan-een-gezonde-leefstijl
    I have unedited the php-file, so you can see the result including the unwanted 4 lines above the form.

Viewing 16 posts - 1 through 16 (of 16 total)
  • You must be logged in to reply to this topic.