Support

Home Forums Event Espresso Premium EE3 [3.1.27] duplicated event failed to get new event post

EE3 [3.1.27] duplicated event failed to get new event post

Posted: April 1, 2015 at 4:09 pm

Viewing 21 reply threads


Bret Weinraub

April 1, 2015 at 4:09 pm

in 3.1.27 EE3, we duplicated an event.

That worked, but the new event is pointed to the old event’s event posts.

We can upgrade to EE3 latest, but how do we fix this new event [it already has attendees].


Jonathan Wilson

April 1, 2015 at 4:25 pm

Hi Bret,

Sorry for the trouble. Can you explain what you mean that the new event is pointed at the old event’s post?

Is the new event showing in the dashboard?


Bret Weinraub

April 1, 2015 at 5:58 pm

Yeah the new event is there; and everything is ok.

But if you click on the duplicated event from the calendar, you end up at the original event’s event post, which is a bit disorienting for the user.

Is there just some “meta” somewhere that can get fixed?


Josh

  • Support Staff

April 1, 2015 at 6:27 pm

Hi Bret,

I turns out, the duplicate an event feature in EE3 was designed around the idea that there’d only be one WP post instead of duplicated posts. This was done because there were some concerns over duplicating blog post content and the potential negative SEO impact from the duplicated post content.

The later versions of Event Espresso 3 ( version 3.1.37+ ) have a filter that can be used in a small custom function to override the default behavior and make a new post when an existing event is duplicated.

Here’s the code you’ll add to a custom snippets plugin or your theme’s functions.php file:

function my_override_event_post_id (){
    return 0;
}
add_filter( 'filter_hook_espresso_existing_post_id', 'my_override_event_post_id' );

If you’d prefer not to update at this time, you can can go in and hardcode the change in your older copy of Event Espresso 3. You FTP in and edit /event-espresso/includes/event-management/copy_event.php and look around line 46 where it has this:

'post_id' => $event->post_id,

and you change it to this:

'post_id' => 0,


Bret Weinraub

April 2, 2015 at 9:52 am

Actually it seems I’ve misfiled this support request, as it appears that there’s more going on here as opposed to just the same event post.

I think our next step is to upgrade.

Thanks,
Bret


Lorenzo Orlando Caum

  • Support Staff

April 2, 2015 at 12:37 pm

Hi there Bret,

We have a changelog available for Event Espresso 3 here:

https://eventespresso.com/wiki/change-log/

Be sure to backup your site before making any changes:

https://eventespresso.com/wiki/updating-event-espresso/#update_manually


Lorenzo


Bret Weinraub

April 2, 2015 at 5:48 pm

It seems that I mispoke, the cloned events are pretty much non functional.

Will upgrade to 3.1.37.1.P and report back.

Now for that effort, I cloned this site and found a new problem:

WHen I click through to the event, I see this:

http://content.screencast.com/users/bretweinraub/folders/Jing/media/9082e7f6-ddc0-4010-bb27-b9993d717d7d/00001142.png

On this clone, I did upgrade to 3.1.37.P – but the problem persists.

I assume the problem to be in the database [in postmeta somewhere]. Where do I look?

I think what I’d like to propose is
– we fix this
– we pursue upgrade

Thx for your continued assistance. I didn’t build this site…. but its in my lap now.


Lorenzo Orlando Caum

  • Support Staff

April 2, 2015 at 7:46 pm

Hi,

The honest answer is I’m not sure what is causing that as the version that you are running is from 2012.

On the test site that was upgraded, does the issue continue if you create a new event and then try to duplicate?

One other thing to be aware of is any template customizations would need to be updated so if you have customizations in /wp-content/uploads/espresso/templates — then try temporarily switching them off by renaming the templates folder to templates1.


Lorenzo


Bret Weinraub

April 4, 2015 at 12:23 pm

Yes the issue persists even when creating a new event … even without duplicating them. I’ll check again after moving the templates off.

The data that is rendered for the date, etc.; where does it live?


Bret Weinraub

April 4, 2015 at 1:08 pm

Let me clarify, the issue persists on the clone.


Bret Weinraub

April 4, 2015 at 1:54 pm

Looks like the root problem is back in the child theme and the use of [no lie]

PHP short tags aka

<?=
<?

sorry for the disturbance. So back to retesting of 3.1.37 fixes our event duplication problem.


Bret Weinraub

April 4, 2015 at 2:07 pm

Better …. hit this:

https://eventespresso.com/topic/fatal-error-during-registration-after-plugin-upgrade/

Fixing


Bret Weinraub

April 4, 2015 at 2:26 pm

After addition Testing …. it seems it pretty much works.

But a LOT of confusion seems to be related to :

– once you duplicate the event, you are editing the new event [but it has the same name].
– if you change the name of the event, THAT changes the name of the connected event post
– now the ORIGINAL event, if you click through, has the name of the duplicated event.

Is there any way to get individual event posts for this? The end client, they use event names like this:

‘[Event Location] – [Event Date]’

So they will never be able to use this format and duplicate events, because they end up changing the name of the original event post and its a mind scrambler.


Lorenzo Orlando Caum

  • Support Staff

April 5, 2015 at 9:08 pm

Hi, any changes should only apply to the actual event that is being tested. Please see this quick screencast:

http://cl.ly/0D1V2J3V243Y/Screen%20Recording%202015-04-05%20at%2011.06%20PM.mov


Lorenzo


Bret Weinraub

April 6, 2015 at 9:57 am

Hi Lorenzo –

That .mov file, at least for me I get no audio out of it.


Lorenzo Orlando Caum

  • Support Staff

April 6, 2015 at 10:13 am

Hi,

It is similar to an animated GIF so there is no audio.

It was to show that on a testing site, the duplicated event was edited and the original event was not.


Lorenzo


Bret Weinraub

April 7, 2015 at 10:28 am

OK … I think a lot of the problems we are having relate to how this site implementor used the event post.

I think they assumed there’d be a one to one relationship between event and event post, but it sounds like this just isn’t the case, correct?

So some questions:

– when you edit an event, are there any “automated” modifications applied to the event post? If not, it seems our integrator built something like this.
– is there anyway [via a hook?] to force a “duplicate event” click to also duplicate the event post? I think this will probably be our final solution.
– EE4 … does it use the same database model as EE3? Its starting to seem like this site will be difficult to upgrade…..


Josh

  • Support Staff

April 7, 2015 at 1:52 pm

Hi Brent,

I’ll follow up with each of your questions below:

– when you edit an event, are there any “automated” modifications applied to the event post?

Yes, it updates the post based on the event content

– is there anyway [via a hook?] to force a “duplicate event” click to also duplicate the event post? I think this will probably be our final solution.

Yes, the code I shared with you earlier will make it so when you duplicate an event, a new post will be created that’s associated with the newly duplicated event.
https://eventespresso.com/topic/ee3-3-1-27-duplicated-event-failed-to-get-new-event-post/#post-149488

– EE4 … does it use the same database model as EE3? Its starting to seem like this site will be difficult to upgrade…..

No, there’s a lot that changed from EE3 to EE4. However, if you want to update from EE3 to EE4 it gives you the option to migrate your event and attendee data into EE4 automatically.


Bret Weinraub

April 8, 2015 at 4:34 pm

I’m a bit confused. So I see on wp_postmeta that there is an event_id in there.

So how does that allow two events to be “linked” to the same event post…..

Specifically, where is the event post ID stored in relation to the event?


Bret Weinraub

April 8, 2015 at 4:53 pm

Found it!:

select id,post_id from wp_events_detail order by post_id;


Lorenzo Orlando Caum

  • Support Staff

April 9, 2015 at 10:44 am

Hi, did you have any other questions related to the upgrade process or on the current version of Event Espresso 3?


Lorenzo


Bret Weinraub

April 9, 2015 at 11:02 am

We are resolved. Actions we took

– we upgraded to 3.1.37.1.P
– we manually deleted the events that had been previously duplicated.
– we took the suggest fix into our child theme’s functions.php

So for future users, here’s my query that found our “bad events” [duplicated events, where the event post title didn’t match the event title]:

select event_name,
	   post_title,
       wp_events_detail.id as event_id,
	   post_id,
       submitted 
from   wp_events_detail,
       wp_posts
where  wp_events_detail.post_id in 
	   (
		select  post_id 
        from    wp_events_detail 
	    group by post_id 
	    having count(post_id) > 1
	   )
and    wp_events_detail.post_id = wp_posts.id
and    post_title <> event_name
order  by submitted, post_id ;
Viewing 21 reply threads

The support post ‘EE3 [3.1.27] duplicated event failed to get new event post’ 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.

Event Espresso