Events Made Easy Forums Generic Empty Space/Lines Displayed when using [eme_mybookings]

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #57036
    Anonymous
    Inactive

    Since the last big update, I’ve noticed that mybookings are not displaying like they were previously. Trying to display all the bookings a user has made for a specific year. Since the last update, we are getting a bunch of blank lines before the list of a person’s bookings and a few blank lines within the list. Any ideas what might be causing this? There appears to be more blank lines for more established users who have made a lot of bookings in the past.

    Using the following code in the template:
    [eme_if tag="#ESCY" value="2017"]#_STARTDATE — #_LINKEDNAME #_STARTTIME to #_ENDTIME[/eme_if]

    On the page where the bookings are to be displayed, using the following shortcode:
    [eme_mybookings template_id=37 template_id_header=5 template_id_footer=7 future=0]

    Thank you for any help you can offer!

    #57037
    Franky
    Keymaster

    EME doesn’t add blank lines, so it is probably in your template. Based on your description, I’m guessing you have br-tags in your template but outside the eme_if logic, meaning they will show for every booking.

    #57040
    Anonymous
    Inactive

    I double checked, there are no br-tags in the template. And some users do not have the extra blank space at all. And most of the time the blank space appears together – so 3 inches of blank space, then a number of bookings appear one line per booking together (no blank space), then an inch of blank space, and then another booking or two.

    It appears users who have had a lot of bookings have the large blank space versus those with one or two bookings don’t have any blank space.

    Could it be something in the data? Could there be bookings in the data without the info I’m trying to display? (STARTDATE, STARTTIME, etc.). What field does the year come from where I’m comparing it to “2017”? Maybe if I can display other fields in the record that are not blank, it might give me a clue as to why it is displaying the lines? Seems like it is making the match on the year, but the data I’m displaying is blank – not sure why that might be, but I’m just trying to think of other places to look.

    Thanks for your help!

    #57041
    Franky
    Keymaster

    Make sure to check the ‘text’-view. Also, show the complete template you use. The eme_if logic won’t show the text if the evaluation is false, meaning (in your case) it will only show lines from 2017.
    Don’t forget: an empty line at the end after your ‘if’ might be the cause too … (that gets translated to br-tags). Check the resulting html to be sure of that (add some text immediately after the closing eme_if to test that)

    #57043
    Anonymous
    Inactive

    Thank you for the idea to put some text after the closing eme_if. I have figured out what it is doing. It is displaying a line for all the person’s bookings each time, but if it doesn’t meet the criteria — meaning if the event was in 2016 — it just shows that line as blank (as opposed to not displaying it at all) – and then it shows the desired text for all the events that were in 2017. I know it didn’t used to do that because I had templates that would just show a particular month and year so I could group each month together.

    Is there any other way I can suppress those lines from displaying? Or am I missing something in my eme_if statement?

    Thanks!

    #57046
    Franky
    Keymaster

    So it is as I suggested. Just remove the empty line before and/or after the [eme_if] (so it “sticks” to the previous/next line) and you’re good to go.

    #57085
    Anonymous
    Inactive

    Hi Franky, sorry to bring this up again, but I don’t think I was clear on the problem we are experiencing. What I found out when testing a little more is that the lines are actually not “empty” and we do not have an empty line before or after the [eme_if].

    The system is actually still displaying lines for events that do not meet the criteria in the [eme_if] – it is just not displaying any “data” with them (which makes them appear “blank”). It does though display the data for the lines that meet the criteria in the [eme_if] statement.

    So what we are getting is what appears to be a bunch of blank lines (which really represent the events the person registered for in 2016) and then the events for 2017 show the StartTime/EndTime as requested. So it appears as if the [eme_if] is only working partially, it does differentiate on the data based on the criteria, but it’s not suppressing lines for the events that shouldn’t be shown.

    So our display looks something like this (where the blank lines are really events with a start date in 2016 the person registered for after they registered for the 2017 events):
    event with a startdate in 2017
    event with a startdate in 2017

    event with a startdate in 2017
    event with a startdate in 2017

    The [eme_if] statement we are using looks like this (our eme_if’s were working fine for a long time – the problem appeared after one of the recent updates):
    [eme_if tag="#ESCY" value="2017"]#_STARTDATE — #_LINKEDNAME — #_STARTTIME to #_ENDTIME[/eme_if]

    Any help you could offer would be greatly appreciated. thanks!

    #57087
    Franky
    Keymaster

    You still haven’t shown the format you use. I’m guessing there’s a break/newline before and after the [eme_if] section.
    And in fact you should blame wordpress for all this: their editor removes br-lines when switching between visual and text editor, and since I don’t know in which editor you made this, I do the following (simple logic, the same is used by wp): replace all leftover br-lines by newlines, and then replace all newlines by br (in case of html of course).
    So a newline before and after your [eme_if] will cause this, but as long as you don’t show the format, I can’t tell you for sure.

    #57094
    Anonymous
    Inactive

    I’m not sure what you mean by I haven’t shown the format I use. Do you mean the eme_bookings statement? If so, I’ve included it below. Please let me know if there’s something else I can provide to help figure out the issue:

    Here is what I’m trying to display on the page:
    <p style=”text-align: left;”>All My Events:
    <span style=”font-size: 12px;”>(shown in registered order – oldest to newest)</span></p>
    [eme_mybookings template_id=3 template_id_header=5 template_id_footer=7 future=0]

    Where:

    template_id 3 = [eme_if tag="#ESCY" value="2017"]#_STARTDATE — #_LINKEDNAME — #_STARTTIME to #_ENDTIME[/eme_if]
    template_id_header 5 = <ul>
    template_id_footer 7 = </ul>

    I checked all the templates, there are no extra lines/new lines that I can see. And none of these templates have been changed for a long time. Recently, they were just showing the events from 2017 (no blank lines).

    When I remove the eme_if statement and show all the bookings, it shows the same number of lines with the eme_if – where the blank lines were, 2016 events are now displayed.

    For example:
    event with 2016 date (blank line with the eme_if statement)
    event with 2016 date (blank line with the eme_if statement)
    event with 2017 date
    event with 2017 date
    event with 2016 date (blank line with the eme_if statement)
    event with 2017 date
    event with 2017 date
    etc…

    #57097
    Franky
    Keymaster

    Ok, this is more info (but please in the future use the “code” button).
    Your header/footer template are ul, but your entry template doesn’t use “li”. This is not valid html …
    First change either your header/footer templates to something else, or if you want to keep the ul, change your template 3 to:
    [eme_if tag="#ESCY" value="2017"]<li>#_STARTDATE — #_LINKEDNAME — #_STARTTIME to #_ENDTIME</li>[/eme_if]

    #57100
    Anonymous
    Inactive

    Ok, thanks, sorry about that. I had the “li” in there before and removed it when I was testing to try to figure out what was going wrong. Put it back in and I get the same results. Tried it also by using blank header/footer templates without the “li” – also same results.

    Here’s the code from the page displaying the bookings where the extra lines are displayed – the header/footer templates are empty (w/eme_if):

    <p style="text-align: left;"><strong>All My Events:</strong>
    <span style="font-size: 12px;">(shown in registered order - oldest to newest)</span></p>
    [eme_mybookings template_id=37 template_id_header=43 template_id_footer=45 future=0]

    Here’s the code from template 37:
    [eme_if tag="#ESCY" value="2017"]<strong>#_STARTDATE -- </strong>#_LINKEDNAME <strong>--</strong> #_STARTTIME to #_ENDTIME[/eme_if]

    Here’s the code from the page where the bookings are displayed as expected (no eme_if):

    <p style="text-align: left;"><strong>All My Events:</strong>
    <span style="font-size: 12px;">(shown in registered order - oldest to newest)</span></p>
    [eme_mybookings template_id=3 template_id_header=5 template_id_footer=7 future=0]

    Here’s the code from template 3:
    <li><strong>#_STARTDATE -- </strong>#_LINKEDNAME <strong>--</strong> #_STARTTIME to #_ENDTIME</li>

    Here’s the code from template 5 (header):
    <ul>

    Here’s the code from template 7 (footer):
    </ul>

    The big difference between the two displays appears to be the eme_if statement. What do you think?

    #57102
    Franky
    Keymaster

    So, the template with id 37 doesn’t contain a newline after the eme_if-endtag.
    Then the error is in the function eme_nl2br_save_html … and I think I found the reason.
    It is in the function eme_nl2br_save_html, where I loop through all the lines if html is found (and in your case: the strong-thing is html, so I’m guessing it should be ok if you didn’t use html). At the end of each line, I add a br+\n, without checking first if I should really be adding that at the end …
    I now implemented a check for that, so could you try if this changeset fixes it for you:

    https://plugins.trac.wordpress.org/changeset/1781653/

    #57103
    Anonymous
    Inactive

    YES! It seems to have done the trick! Thank you so much for sticking with me through this.

    #57105
    Franky
    Keymaster

    No, thank you for insisting on this problem! Sometimes I just don’t see the bug when there really is one!

Viewing 14 posts - 1 through 14 (of 14 total)
  • The forum ‘Generic’ is closed to new topics and replies.
Scroll to Top