Posted: 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 |
|
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…. Is already loaded via a hook:
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.
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). |
|
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 { Would these particular changes be achievable via a custom plugin? Thank you Daniel |
|
Whats the use case here? A custom waitlist function? |
|
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/ |
|
I can’t see any go to waitlist button there? |
|
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 |
|
…and that’s the way it was appearing on the site when I wrote to you a couple of hours ago! |
|
The button you can see on the JPG appears when an event is sold out and simply links to our Contact Us page. |
|
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! |
|
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. |
|
I didn’t realise (or had forgotten) that that add-on existed! I’ll give it a go. Thank you Tony. |
|
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. |
|
p.s. presumably it’s possible to customise the colour of the waiting list button and the text? |
|
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? |
|
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/
You’ll just need some additional CSS for that, but sure.
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. |
|
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. |
|
Can I take a look? If so send temp login details using this form: |
|
Thanks Tony! I believe that I’ve just sent you temporary login credentials. |
|
This reply has been marked as private. | |
I’ve sent you a password reset link to your support address. Please confirm receipt. |
|
This reply has been marked as private. | |
This reply has been marked as private. | |
Awesome, I’ve replied via email. |
|
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 |
|
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 🙂 |
|
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 |
|
You’re most welcome, please do keep me updated 🙂 |
|
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.