Support

Home Forums Event Espresso Premium All Registrations CSV Report causes critical error on website

All Registrations CSV Report causes critical error on website

Posted: January 24, 2020 at 12:25 pm


Jace

January 24, 2020 at 12:25 pm

I started working on this before the holidays and have been on other projects since, but picking up this problem where the All Registrations Export causes a fatal failure. The initial message we say had a reference to the customization php file. That file can be read here: https://pastebin.com/cWryAbtH


Josh

  • Support Staff

January 24, 2020 at 1:05 pm

Hi Jace,

I found a few mistakes with how the last two functions were closed. If you look at the ee_mer_change_event_list_url() function that starts on line 269, you’ll see there’s no closing bracket
}
after the return statement on line 270.

You can put a closing bracket on line 271, then remove the closing bracket on line 276.

Then do the same for after return on line 280 (add a closing bracket) then remove the closing bracket line 282.

After that, if you’re still having trouble, it may help to get the latest PHP fatal error.

Just a guess, but if there happens to be a primary registration that does not have an attendee record due to some direct database manipulation, the code in the tw_ee_populate_additional_registrants_questions_using_primary_reg function could contribute to a fatal error. This can be avoided by adding some defensive checks. For example right after where you have this:
$primary_attendee = $primary_registration->attendee();
You could add:

if(! $primary_attendee instanceof EE_Attendee) {
	return $reg_csv_array;
}


Jace

January 27, 2020 at 3:25 am

Thanks Josh! That worked. I’ve updated the code and included the defensive checks. Thanks!!

I deactivated the plugin to test and when I reactivated, I get this message:

The plugin generated 4 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.

Should I be looking for logs somewhere or are you may be able to see what might be wrong in the code?

https://pastebin.com/jrsV1hRh

Thanks, as always!!


Josh

  • Support Staff

January 27, 2020 at 7:38 am

It could be caused by the whitespace on line 1 before the opening PHP tag. The whitespace should be removed, then you could try activating the plugin again.


Jace

January 27, 2020 at 11:27 am

Spot on, Josh! Thanks so much!

The support post ‘All Registrations CSV Report causes critical error on website’ 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  Jace 2 weeks, 6 days ago ago

Topic Tags

Notifications

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