Support

Home Forums Event Espresso Premium Use of undefined constant ticket

Use of undefined constant ticket

Posted: September 12, 2018 at 3:29 pm


Mana Retreat

September 12, 2018 at 3:29 pm

Hi
Just completed normal update of EE4 and now get this error message and our event table no longer displays. – Page URL in question – https://manaretreat.com/retreats-courses/event-schedule/
Error thrown
[] operator not supported for strings.

[12-Sep-2018 21:13:08 UTC] PHP Warning: Use of undefined constant ticket – assumed ‘ticket’ (this will throw an Error in a future version of PHP) in /home/manaret1/public_html/wp-content/uploads/espresso/templates/ticket_selector_chart.template.php on line 445

Any help would be much appreciated.


Josh

  • Support Staff

September 12, 2018 at 3:33 pm

Hi,

The PHP warning is actually originating from the custom code located in your site’s uploads folder. May I ask what’s the contents of that file on and around line 445?


Mana Retreat

September 12, 2018 at 3:56 pm

Hi Josh
Thank you for your prompt reply.

The specific line at 445 is:<?php endif; ticket //end template_settings->show_ticket_details check?>

Ticket selector table display do actions.


Josh

  • Support Staff

September 12, 2018 at 4:00 pm

That does not look like valid PHP code, maybe something got rearranged there by mistake while editing?

In any case, it looks like that should be changed to:
<?php endif; ?>


Mana Retreat

September 12, 2018 at 4:35 pm

Have changed the line of code as suggested above but still get error on page and ticketing chart dosen’t display.
This file hasn’t been changed or edited since installation and previously worked.
We did update our php to version 7.2 if that is relevant.
I’m happy to send ftp details if useful.


Mana Retreat

September 12, 2018 at 5:44 pm

Regarding the error msg on the page:[] operator not supported for strings
I found several instances of [] as per code snippet from the ticket_selector_chart.template.php file.

https://gist.github.com/lorenzocaum/92dd4db9e1fc159b9a928cbcb58b0fe4


Mana Retreat

September 12, 2018 at 5:53 pm

Hi Josh
I reverted our PHP version back to V:7.0 from 7.2 and all works again.
Many thanks for your support.
Kind regards Stephen


Josh

  • Support Staff

September 12, 2018 at 6:18 pm

The code snippet didn’t appear to have anything related to the error, message, but in any case it will best if your developer can update the custom code so it’s ready for PHP 7.2.

The support post ‘Use of undefined constant ticket’ 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