Support

Home Forums Event Espresso Premium Solution to multiple Event Price and Ticket when creating new event

Solution to multiple Event Price and Ticket when creating new event

Posted: March 23, 2017 at 3:28 am


Nicolas Alberto

March 23, 2017 at 3:28 am

I finally found the solution to a very long lasting issue in EE3.
The db gradually adds up orphan prices and tickets which become default prices and tickets prices when you create a new event.

It has been reported before:
https://eventespresso.com/topic/unwanted-multiple-event-pricing-and-event-times-when-creating-new-event/
https://eventespresso.com/topic/add-event-displays-57-start-times-how-to-get-rid-of-them/#post-157228
https://eventespresso.com/topic/new-events-are-created-with-multiple-event-times-listed-ee3/

The issue comes from the event-identifier field. This field has a limited length in the db. When you create an event with a long title, EE creates a default event identifier by concatenating the title and event id. When it is too long the script stops but the pricing and times are already added to the db and become orphan.

My temporary solution was to have an overnight query removing the orphan prices and times but you can get rid of this problem with the changes below.

My solutions:
In the plugin/event-espresso/includes/event-management/insert_event.php

Change near line 80:
—THIS—
if (!isset($_REQUEST[‘event_identifier’]) || $_REQUEST[‘event_identifier’] == ”){
$event_identifier = sanitize_title_with_dashes($event_name . ‘-‘ . $event_code);
}else{
$event_identifier = sanitize_title_with_dashes($_REQUEST[‘event_identifier’]) . $event_code;
}

—TO THIS—
if (!isset($_REQUEST[‘event_identifier’]) || $_REQUEST[‘event_identifier’] == ”){
$event_identifier = sanitize_title_with_dashes(substr ( $event_name , 0 , 20 ) . ‘-‘ . $event_code);
}else{
$event_identifier = sanitize_title_with_dashes($_REQUEST[‘event_identifier’]) . $event_code;
}

I hope it helps someone.


Tony

  • Support Staff

March 23, 2017 at 7:32 am

Hi there,

Can you let me know which version number of Event Espresso 3 you are currently using please?


Nicolas Alberto

March 23, 2017 at 7:21 pm

3.1.36.6.P Version 4.7.3


Tony

  • Support Staff

March 24, 2017 at 4:05 am

Thank you.

The above fix should work, however if you update to the latest version of Event Espresso 3 (currently 3.1.37.11) you should find this prevents the additional prices from being created as we already have fixes in place to prevent this.

The support post ‘Solution to multiple Event Price and Ticket when creating new event’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3

Documentation for Event Espresso 4

Status: closed

Updated by  Tony 2 years, 2 months ago ago

Topic Tags

Notifications

This topic is: not resolved
Do NOT follow this link or you will be banned from the site!