Support

Home Forums Event Espresso Premium Do upgrades to EE Core wipe all files?

Do upgrades to EE Core wipe all files?

Posted: May 31, 2023 at 8:11 am

Viewing 27 reply threads


drkings1

May 31, 2023 at 8:11 am

Hi there,

I’ve just had some developers make some customisations to the core plugin of EE4 for me, which are working fine, and they’ve given me a changelog so I know exactly what they have altered.

The changes are not extensive, but of course, they are significant (to me and my site).

Clearly if I update the EE4 Core plugin there is a chance that some or all of this code will get wiped and I’ll need to reapply the patch.

The files concerned are:

1) event-espresso-core-reg/caffeinated/modules/ticket_selector_caff/templates

ticket_selector_price_details.template

2) event-espresso-core-reg/modules/ticket_selector/

DisplayTicketSelector.php

~

My questions to you are:

1) Whether these particular files are likely to be overwritten any time I upgrade EE to a new version, or whether they are only changed on upgrade if you’ve changed the code in them.

2) If not, whether it is clear from the changelog (or elsewhere) which files are implicated in any given upgrade?

~

Clearly I need to know whether or when I’m going to need to patch the code on upgrading the core, and this information would be very helpful to me.

thank you for your help

Daniel


Tony

  • Support Staff

May 31, 2023 at 8:27 am

Hi Daniel,

I can’t stress enough how much we discourage people from modifying core files such as the above. We already included thousands of hooks within Event Espresso and thats not including the WP Core hooks that can also be used for some things (although likely not for either of your customizations mentioned).

The ‘correct’ method for this would be to open an issue requesting a hook is added into the files to allow you to make changes via a hook, or a method to allow your developer to hook in and override a class for example. Which can then be included within a custom plugin which sits and hooks into EE to modify what is needed.

Having said that…. ticket_selector_price_details.template.php

Is already loaded via a hook:

AHEE__ticket_selector_chart_template__ticket_details__after_description

Which means the developers could have hooked into that, removed our default hooked function and replaced it with their own template file loaded from a custom plugin.

DisplayTicketSelector.php we don’t have a lot of hooks available within and part of the reason for that is because the ticket selector is the process that starts ALL registrations, it’s a critical element for registrations and customizing the code there can cause issues as we change things later on. For example when using the Multi Event Registration add-on if the code has been altered it can cause issues when adding tickets to the cart (this has happened previously so not just a hypothetical).

We are open to adding additional hooks into it but we do weight those up with possible issues caused from them before they are included.

Now to actually answer your question.

Within WordPress EVERY time you update a plugin, what it actually does is download the .zip file containing the latest version, delete the current plugin directory and extract the contents of the .zip file in its place.

So every plugin update replaces every file.

Note that out update system basically hooks into WordPress to tell it where to download the .zip from, everything else is WordPress core itself (not strictly speaking but for everything referenced here that’s correct).


drkings1

May 31, 2023 at 9:11 am

Hi Tony,

Thank you for your helpful answer.

I completely understand!

And I can’t say I was best pleased when (after 2 weeks of development time) my developer told me that they they had solved my issues by editing the EE Core.

But they assured me (almost certainly incorrectly now reading your reply) that this was the only way it could be done.

As a layperson with only very rudimentary coding experience, I wasn’t qualified to question them on this or disagree with them on it. In future if such a question arises I will go to you first!

Down the line I may see if I can get these changes put into a custom plugin if it’s at all possible.

With regard to the edit to DisplayTicketSelector.php it is this:

It is an edit to lines 702-718, so that they now read:

} else {
if (
apply_filters(
‘FHEE__EE_Ticket_Selector__display_ticket_selector_submit__no_tickets_but_display_register_now_button’,
false,
$this->event
)
) {
$html .= $this->displayRegisterNowButton();
}
$html .=’<span class=”theme-button-inner”>’.__(‘Go onto waiting list’,’presence’).'</span>‘;
// no submit or view details button, and no additional content
$html .= $this->ticketSelectorEndDiv();
}
~

Would these particular changes be achievable via a custom plugin?

Thank you

Daniel


Tony

  • Support Staff

May 31, 2023 at 9:31 am

Whats the use case here? A custom waitlist function?


drkings1

May 31, 2023 at 9:48 am

Hi Tony,

I believe that the use case is that the “Add to Cart” button becomes a “Go onto waiting list” button that links to the Contact page on the website.

If I’m correct the page below is an example of this in action:

https://staging4.presencetraining.co.uk/courses/foundation-one-8-9-june-2023-london-wc1n-3al/


Tony

  • Support Staff

May 31, 2023 at 10:29 am

I can’t see any go to waitlist button there?


drkings1

May 31, 2023 at 11:01 am

Strange!

I’m guessing that the developers must have temporarily deleted the code and are re-applying it.

It should look like this (see JPG):

https://drive.google.com/file/d/1-_Daq6NBGiq4k-D2apKX_fExk6g85P7Q/view?usp=sharing


drkings1

May 31, 2023 at 11:04 am

…and that’s the way it was appearing on the site when I wrote to you a couple of hours ago!


drkings1

May 31, 2023 at 11:06 am

The button you can see on the JPG appears when an event is sold out and simply links to our Contact Us page.


drkings1

May 31, 2023 at 11:10 am

If there is an easy way of implementing this via a custom plugin (or otherwise) without my developers hacking at the core code I’d love to know. Because I’ll probably insist that they do that instead!


Tony

  • Support Staff

May 31, 2023 at 1:17 pm

Without knowing what the code is actually doing its hard to say.

But you have the everything license and it ‘sounds’ like what you are trying to do is similar to the waitlist add-on (which does indeed change the button without hacking up core).

Install the waitlist add-on and test out what happens with that add-on, not so much everything else the waitlist add-on does, but how it changes the ticket selector output to include the button.

Is that what you are looking for?

If so, Yes, that can indeed be done without modifying core.


drkings1

May 31, 2023 at 1:40 pm

I didn’t realise (or had forgotten) that that add-on existed!

I’ll give it a go. Thank you Tony.


drkings1

May 31, 2023 at 2:29 pm

I’m trying to test the wait list module, and I’ve installed it. (Using EE 4.10.13)

It appears as per the instuctions in the backend when I select an event.

When I update the number of wait list tickets from 0 to (say) 10 and hit “update” the number of wait list places doesn’t get saved and stays at 0.

So I can’t save the event more more than 0 wait list places.

Any idea what may be going on here and why it won’t let me have more than 0 waiting list places on an event?

I thought it might be because the event was sold out, so I tried making the status of the event such that it had a place left, but it didn’t make any difference. I still couldn’t save the event with a non-zero number of wait list places.


drkings1

May 31, 2023 at 2:58 pm

p.s. presumably it’s possible to customise the colour of the waiting list button and the text?


drkings1

May 31, 2023 at 3:05 pm

p.p.s. When I installed the plugin it did say it had installed successfully but I did get the following error/comment on the installation page:

Warning: Creating default object from empty value in /home/customer/www/presencetraining.co.uk/public_html/wp-content/plugins/event-espresso-core-reg/core/third_party_libs/pue/pue-client.php on line 1776

Could this explain why the plugin isn’t functioning as it should?


Tony

  • Support Staff

May 31, 2023 at 11:41 pm

Any idea what may be going on here and why it won’t let me have more than 0 waiting list places on an event?

Hmm, strange! No errors shown on the page at all?

If you edit the event and open up your browser’s Dev Tools, then search for ‘input’ in the elements section, like this:

https://monosnap.com/file/IJoI11kZcWcDeMj7bhnBoXiQjp5Fyj

How many instances of input does it find on the page?

I don’t know which browser you using but Chrome has details on their dev tools here: https://developer.chrome.com/docs/devtools/open/

p.s. presumably it’s possible to customise the colour of the waiting list button and the text?

You’ll just need some additional CSS for that, but sure.

Could this explain why the plugin isn’t functioning as it should?

No, that’s an issue we fixed a while back, its related to our plugin update engine (PUE) and wont effect how the add-on works.


drkings1

June 1, 2023 at 1:46 am

If I’ve done the Elements search correctly it says “no matching selector or style”.

But the page is otherwise functioning correctly, so I don’t know if I’ve performed the search correctly.


Tony

  • Support Staff

June 1, 2023 at 1:55 am

Can I take a look? If so send temp login details using this form:

https://eventespresso.com/send-login-details/


drkings1

June 1, 2023 at 2:57 am

Thanks Tony! I believe that I’ve just sent you temporary login credentials.


Tony

  • Support Staff

June 1, 2023 at 3:09 am

This reply has been marked as private.


drkings1

June 1, 2023 at 3:19 am

I’ve sent you a password reset link to your support address. Please confirm receipt.


Tony

  • Support Staff

June 1, 2023 at 4:41 am

This reply has been marked as private.


drkings1

June 1, 2023 at 4:58 am

This reply has been marked as private.


Tony

  • Support Staff

June 1, 2023 at 5:55 am

Awesome, I’ve replied via email.


drkings1

June 2, 2023 at 5:38 am

Hi Tony,

Thank you for all of your help so far.

I’ve just replied to the email chain with what I believe is the last thing that the developers say they can’t do except via hard-coding the EE Core.

Please let me know if there is a “legitimate” work around here that doesn’t involve them hacking your core code about.

Thank you

Daniel


Tony

  • Support Staff

June 2, 2023 at 7:05 am

Hi Daniel,

I’ve replied directly via email, but the code they are referencing is the code I referenced above HERE

That template is loaded via a hook, they need to hook into the hook, remove our callback and add their own to load a template from whatever location they are using.

So, yes, it can be done in a ‘legitimate’ way 🙂


drkings1

June 2, 2023 at 7:11 am

Thanks so much Tony!

I’ve passed that on to the Developers.

I will update you on how this goes.

Hopefully we can end up with a complete solution that doesn’t involve hacking the core code in any way.

Warm regards

Daniel


Tony

  • Support Staff

June 2, 2023 at 7:19 am

You’re most welcome, please do keep me updated 🙂

Viewing 27 reply threads

The support post ‘Do upgrades to EE Core wipe all files?’ 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