Support

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

All Registrations CSV Report causes critical error on website 2

Posted: January 24, 2020 at 12:25 pm

Viewing 4 reply threads


vrwaadmin

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;
}


vrwaadmin

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.


vrwaadmin

January 27, 2020 at 11:27 am

Spot on, Josh! Thanks so much!

Viewing 4 reply threads

The support post ‘All Registrations CSV Report causes critical error on website 2’ 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