• Resolved Hanno

    (@bsoftde)


    Event titles that contain quotation marks (example: “Bunte Gemeinde”) are saved to the database with additional backslashes (\”Bunte Gemeinde\”) if the front end editor is used. In the events list, the title is displayed exactly so: \”Bunte Gemeinde\”.
    If the event is inserted via the backend, this does not happen.
    Can you please take care of that, or have I missed something?

Viewing 10 replies - 1 through 10 (of 10 total)
  • I tried this but I was unable to reproduce the problem. ?Try switching to a default theme (e.g., Twenty Twenty-Three) and see if that resolves the problem. If not, try disabling all of the plugins other than Events Manager and then enable them one at a time to see which one is causing the problem.

    Thread Starter Hanno

    (@bsoftde)

    Thank you for your quick response.
    I now installed the plugin on a different (“empty”) site, for testing. I found out that the problem only occurs if the plugin generates an error message before saving the event to the database.
    Eg.: A new user does not check the agreement box at the bottom.
    Or: You forget to provide an event date.
    Consequently, an error message is generated, and the field contents that have already been provided by the user are then re-displayed. If the text contains characters that would have to be escaped, you will see the additional escape character.
    Hope that helps.

    I tried to add an event without providing a date and it gave me an error message and didn’t create the event. How did you create the agreement box for new users? Are you using a GPDR plugin?

    Thread Starter Hanno

    (@bsoftde)

    If there is an error it doesn’t create the event, that’s right. However, the title field below the error message now contains the misformatted text. If I correct the errors, and leave the other things that have already been provided as they are, all data are now stored in the database, including the misformatted title.
    And no, I do not use a GDPR plugin. This is a setting of your own plugin: Privacy > Consent > Remembering consent

    First of all I am not the owner of the plugin. I’m just trying to help people out in the community forum.

    I was having trouble reproducing the problem because I was using the following for the title:

     “Bunte Gemeinde”

    Once I changed it to this, I was able to reproduce the problem:

     "Bunte Gemeinde"

    Hopefully, the plugin owner will fix this.

    Thread Starter Hanno

    (@bsoftde)

    Oh I see! Thanks anyway.

    You can fix this problem by adding the following code snippet:

    add_filter( 'em_event_get_post', function( $result, $EM_Event ) {
        if ( ! empty($EM_Event->event_name ) )
            $EM_Event->event_name = stripslashes( $EM_Event->event_name );
        return $result;
    }, 10, 2 );

    You can use the Code Snippets plugin to add the code snippet.

    Thread Starter Hanno

    (@bsoftde)

    It works. Thanks so much.

    TreeTrail

    (@aprilschmitt27)

    @joneiseman, Thank you again for providing excellent support, as an unpaid volunteer!!!

    @joneiseman thanks for the code!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Front end saves quotation marks (“) as escape chars’ is closed to new replies.