Snippet no longer works after 3.11 upgrade.

Home Forums Calendar Products Events Calendar PRO Snippet no longer works after 3.11 upgrade.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #990358
    Dan Feeley
    Participant

    This snippet: https://theeventscalendar.com/knowledgebase/make-phone-numbers-links/ no longer seems to work after the 3.11 upgrade. The number is no longer a link and just displays the following:

    123-098-7654

    #990359
    Dan Feeley
    Participant

    Oh well, I figured the link might not show up right but if you check the URL I gave you will see the problem I mentioned. Thank You.

    #990361
    Dan Feeley
    Participant

    I guess you can add this one to the list as well:
    https://theeventscalendar.com/knowledgebase/make-organizer-email-a-mailto-field/

    It appears to be doing the same thing.

    #990516
    George
    Participant

    Hey @danfeeley,

    The code in these snippets is actually still compatible with 3.11, so let’s address one separately on your site.

    First is the phone-number snippet. You say “The number is no longer a link and just displays the following”, but then it shows a phone number – this number is coming from your event itself, correct? It’s not hard-coded into the snippet so it’s pulling that value from the event venue and if there’s a number there, that means that’s the number from your venue.

    Can you please link to where the phone number is showing on your site?

    Next, can you clarify what you mean regarding the email snippet when you say “It appears to be doing the same thing.”? Do you literally mean that it’s showing the same phone number as the phone snippet? Please also link to a place on your site where we can see this email snippet being used.

    Thank you!
    George

    #990584
    Dan Feeley
    Participant

    This reply is private.

    #990622
    Dan Feeley
    Participant

    My bad, in the above reference I meant multiple organizers (we have it relabeled).

    #990650
    George
    Participant

    No worries @danfeeley!

    I dug deeper and it turns out we’re both kinda right here.

    While I’m correct about the actual snippets on our site having “correct” code, we did recently introduce the addition of some esc_html() calls around the relevant bits of code that output the phone number and email address.

    Now, this is meant with good intentions, as these functions help “sanitize” data and improve security. But it might admittedly be a bit overkill, especially for your customization here.

    Unfortunately, the only way around this is to modify some plugin code. You can either make a whole new template file in your theme and do a whole bunch of copying and pasting and such, which is outlined here → https://theeventscalendar.com/knowledgebase/themers-guide/

    Or, though not typically recommended, you can just head into the plugin code yourself and tweak the code. This normally is not recommended because updating the plugin breaks changes you make like this, but I brought up this dilemma with another developer and we’re probably going to remove these unnecessary esc_ functions in these two cases.

    To manually make this edit to fix this, head to your plugin files for The Events Calendar. Then head to /src/views/modules/meta/organizer.php

    In this file you’ll see two lines of code, which will look like this:

    <dd class="tel">
    <?php echo esc_html( $phone ); ?>
    </dd>

    and this:


    <dd class="email">
    <?php echo esc_html( $email ); ?>
    </dd>

    Remove the esc_html() wrapping functions and you should be good to go, so for example, those above would just become this:

    <dd class="tel">
    <?php echo $phone; ?>
    </dd>

    and this:


    <dd class="email">
    <?php echo $email; ?>
    </dd>

    I hope this helps – let us know!

    Thank you,
    George

    #990688
    Dan Feeley
    Participant

    That appears to have done the job. Thank you very much.

    #991114
    George
    Participant

    Cool! Stay tuned for the next few updates, as we’re hoping to improve this a bit. If you update and the same problem arises again, please have this issue bookmarked and run through the simple changes above to remove the overzealous HTML escaping from our code 🙂

    Cheers!
    George

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Snippet no longer works after 3.11 upgrade.’ is closed to new replies.