Support

Home Forums Event Espresso Premium Registrations – Register and Export

Registrations – Register and Export

Posted: March 5, 2021 at 10:42 am

Viewing 24 reply threads


Dennis Kenny

March 5, 2021 at 10:42 am

We are running Stella Maris (https://stellamaris.org) on a multi-site install, which has not been a problem in the past. However, I wonder if this might be a factor in the following issues.

We are having three issues:

CSV Export:
When exporting a CSV, it seems as if the path of the uploads folder is not being read properly when outputting the final file path. If you export the registrations of an event, it seems to write the file correctly, but the path produced leads to a 404 error. The file exists here: https://www.stellamaris.org/wp-content/blogs.dir/348/files/espresso/batch_temp_folder/6WLvEMlSsu4cPmp/event-espresso-registrations-2021-03-05-17-35-51.csv

However, the path provided is: https://www.stellamaris.org/files/espresso/batch_temp_folder/6WLvEMlSsu4cPmp/event-espresso-registrations-2021-03-05-17-35-51.csv

Frontend Registration:
https://www.stellamaris.org/registration-checkout/?uts=1614958948#checkout
It seems that registrations on the front end are seeming to fail with errors like “first name is required” (despite the first name being present). However, the registration seems to actually go through despite the error and lack of further steps by the front end user.

Backend Registration:
If I manually add a registrant in the backend of the site, I get the following error:
Error Thrown


Tony

  • Support Staff

March 5, 2021 at 4:24 pm

Hi there,

CSV Export
That’s odd, I’ll do some more digging into this and get back to you.

Did exports work previously?

Frontend Registration
Is there a pattern to this at all? Same event or any event?

Logged in or out?

I tested a quick registration and didn’t run into issues but if you know the steps to reproduce I’ll test again.

Note links to the checkout process won’t work for other people, it’s linked to your session so loads fine for you but I can’t view that link. It’s best to include the link to the event your testing and the steps to reproduce it so we can take a look.

Backend Registration

That error is from the messages generating and usually means there is at least one file missing from your EE install.

If you download the latest version from your account page and install it over the current version, does that fix the above error?

I know you already have the latest version installed, but that error is showing that EE is trying to open a file that isn’t there.

Did you previously install via FTP?


Dennis Kenny

March 8, 2021 at 8:58 am

Hi Tony,

Thanks for your quick response!

CSV Export:
Yes, this did work previously.

Frontend Registration:
I don’t think there’s much of a pattern to it to be honest. However, here’s what I did. I did this not logged in and was using the most up-to-date Firefox on a Mac (not sure if that matters).

I went to the first event on the list and tried to register as a volunteer/staff (aka $0). I had all the fields filled out and kept receiving errors that various fields were required and needed information (despite them being filled out).

Backend Registration:
We did install it via FTP. I have just downloaded a fresh version and am in the process of deleting the old files and just re-uploading. I will repeat these tests and reply here with the results.

Thanks again!


Dennis Kenny

March 8, 2021 at 9:29 am

Hi again Tony,

I have finished deleting and re-uploading the plugin. Here’s a quick update to each item.

CSV Export:
This is still having the same issue.

Frontend Registration:
This seems to have been fixed with the new FTP upload. I was able to successfully register for an event without error.

Backend Registration:
This also seems to have been fixed with the new FTP upload. I was able to successfully manually register a user as an admin.

So, it looks like it’s just the CSV link that remains.


Tony

  • Support Staff

March 8, 2021 at 9:52 am

Frontend/Backend registrations.

Great!

CSV Export

Ok, so the URL that is used is whatever is returned by wp_upload_url():

$upload_dir = wp_upload_dir();
 
// Single Site
$upload_dir['baseurl']; // http://example.com/wp-content/uploads
 
// Multisite
$upload_dir['baseurl']; // http://example.com/wp-content/uploads/sites/site_no
// Where site_no = Site ID

So, a couple of questions.

Any plugins to alter the sites wp-content directory?

Or, any code hooking into:

FHEE__EventEspressoBatchRequest\JobHandlerBaseClasses\JobHandlerFile__get_base_folder

(Uses EVENT_ESPRESSO_UPLOAD_DIR defined from wp_upload_dir() above)

Or:

FHEE__EventEspressoBatchRequest\JobHandlerBaseClasses\JobHandlerFile__get_base_url

(Uses EVENT_ESPRESSO_UPLOAD_URL defined from wp_upload_dir() above)


Dennis Kenny

March 10, 2021 at 10:05 am

Hi Tony,

I looked into this and found that the uploads_dir seems to be correct and unaltered by either the theme or other plugins.

I have printed them out just after the opening body tag (in a display:none div) and again just before the closing body tag. You can see them here:
https://www.stellamaris.org/

Any pointers as far as what needs to be adjusted?


Tony

  • Support Staff

March 11, 2021 at 5:35 am

This reply has been marked as private.


Tony

  • Support Staff

March 11, 2021 at 6:04 am

I’ve posted the details from your site in a private reply above just so it’s easier to reference here.

It didn’t occur to me previously that your directories use blogs.dir which means that this is a pre WP3.5 multisite install (I know you’re running the latest WP Version currently but the MS network was set up prior to 3.5) which means it is expected that your baseurl will point to /files as it does. From there ms-files.php takes over and serves the file, it’s the ‘old’ way of doing it that is still used because that’s how your network was set up.

When you said this worked previously, was that also using the batch system? Where when you click on the export it takes you to a progress bar and then directs you to download. Or did it work when you clicked the report and the file downloaded instantly?

Try adding the following to your wp-config.php file to use the old CSV Report feature:

define( 'EE_USE_OLD_CSV_REPORT_CLASS', true );

You add the above to a line above where it says:

/* That's all, stop editing! Happy blogging. */

Does it work then?


Dennis Kenny

March 11, 2021 at 10:00 am

This reply has been marked as private.


Dennis Kenny

March 11, 2021 at 10:07 am

Client got back to me. Prior to this, there was no loading bar. You simply clicked the export button and it would download – no interim screen.


Tony

  • Support Staff

March 11, 2021 at 11:00 am

Ok, so that makes a little more sense then as I couldn’t work out how it worked prior.

The CSV opening in the browser means that either your browser is set to automatically open CSV or the MIME types are incorrect on the server.

Using nginx or Apache?


Dennis Kenny

March 11, 2021 at 12:53 pm

We are using WP Engine as the host, so I believe we have nginx


Tony

  • Support Staff

March 15, 2021 at 4:38 am

Ok, contact WPEngine and ask them to set the following MIME:

application/ms-excel .csv

This may also work:

text/csv .csv;

Then switch EE to use the ‘old’ CSV export using the code I gave you earlier and retry.

I’ve created a ticket to investigate the MultiSite URL used for the export, it works with the ‘new’ MS set up but looks like we may need a shim for the ‘old’ way using ms-files.php


Dennis Kenny

March 15, 2021 at 10:34 am

Hi Tony,

I followed the steps you provided – had WPEngine add the MIME and change the wp-config file to include “define( ‘EE_USE_OLD_CSV_REPORT_CLASS’, true );”

Unfortunately, it didn’t change anything. I still go that page with the csv printed out instead of downloaded.

Any other ideas?


Tony

  • Support Staff

March 15, 2021 at 10:39 am

Can you send me temp login details so I can view the request?

If so, you can use this form: https://eventespresso.com/send-login-details/


Dennis Kenny

March 15, 2021 at 10:51 am

Hi Tony,

I just submitted that for you. Note that I am using. company account (which has my name as Dennis Kenny), but I, typing, am Elly Cabral (elly@illuminage.com) – our Lead Developer. As such, I’ve used my information to fill out that form rather than the company’s global information (makes it easier for me to stay informed this way).

Thanks!


Tony

  • Support Staff

March 15, 2021 at 11:11 am

Have you removed the constant above? EE is currently using the batch system on your site.


Dennis Kenny

March 15, 2021 at 11:26 am

Oh yeah I did. But I just put it back. Sorry about that.


Tony

  • Support Staff

March 15, 2021 at 12:00 pm

The server is still returning a content type of text/html which is why the browser is displaying it.

We already set this when sending the output:

header("Content-Type: text/csv; charset=utf-8");

However, the server can override it and it looks like that is what is happening above. Can you recheck with WPEngine and confirm they have applied the correct MIME type for CSV’s?


Dennis Kenny

March 15, 2021 at 12:47 pm

I reached out to WPEngine and got the following responses:

Thanks for the patience.
It appears the way arounds this is to add the following line to the config.
define( ‘ALLOW_UNFILTERED_UPLOADS’, true );

This is currently in place. I just ran an apply on the config file for this to take affect.

Thanks for the patience. By default the platform disallows this file type [csv] to be uploaded. However we can negate this rule with the defined added to the wp-config.php that’s currently present. Unfortunately we cannot change the configuration to allow by default on the server.


Tony

  • Support Staff

March 15, 2021 at 3:03 pm

I’m not really sure what they are trying to get at there, but that answer doesn’t apply to this issue.

Nothing is being UPLOADED through WP itself here, there is no need to enable ALLOW_UNFILTERED_UPLOADS as the issue is NOT with uploading a CSV file.

EE generates the CSV in a temp location, its not uploaded but generated from data on the site.

The batch process generates the CSV in batch and writes to the temp file location until the total batch has been processed, then streams it to the browser to download. (This is not working on your site with the MultiSite set up you have and whilst we don’t officially support MultiSite I’ve created a ticket to see if we can work around that).

The ‘old’ export system (the one in use when EE_USE_OLD_CSV_REPORT_CLASS is defined) pulls all of the data on a single request, loops over all of the rows and generates a CSV on the fly. Again, that is streamed to the browser from your server.

So nothing in either of those functions is uploading to the site through WordPress. The batch function obviously works in terms of the .CSV file it’s just with your setup but the URL ends up being incorrect, we can tell this works as you have the ‘correct’ URL and can download the CSV.

The ‘old’ system is ‘working’ in the sense that that generates the CSV except the content_type return by the server for that request is set to text/html, so the browser simply outputs it to the page.

To show you this, here are the response headers for a request using the old export on a test site: https://monosnap.com/file/HVRvphHayaU50jiD1boNftC0z2TYRQ

The two headers I’ve highlighted are explicitly set within the request to stream the CSV to the browser as a download.

Now on your site: https://monosnap.com/file/eir9zgCmlkq0xouR5VFnCMhTJCOmlp

Those headers don’t exist there, so something on the server-side is overriding them.

The answer they’ve given above simply doesn’t apply to any of the above so I’m not sure what to recommend you reply with.


Dennis Kenny

March 16, 2021 at 8:44 am

Thank you so much for that explanation! I will work with WP Engine to see what they can do to adjust on their end.

That said, is it fair to assume that if StellaMaris was on a multi-site that used the standard uploads directory (uploads/sites/###), the export would work without issue? In other words, is the primary issue the blogs.dir directory for the new batch system?


Tony

  • Support Staff

March 16, 2021 at 9:25 am

It should do yes, I have a few local installs of multisite and they use the ‘new’ system, I can export registrations there fine.

This is a new install I set up specifically for this thread to confirm:

https://monosnap.com/file/xI3zGT3C5PONV1Gk7QtQdEIUU0ecLv

Note the download location for both of those exports:

https://monosnap.com/file/0oWKa4u98hYfq81Uq4q8O8HKDendNk


Justin

March 16, 2021 at 2:47 pm

I am marking this as a topic I am going to come back to. I have a multisite install (April of 2020 on WP Engine, not sure when ‘new’ system started) as well and wasn’t able to download the export the registrations. It went through the process and looked to generate the csv file, it just didn’t give me the option to download or download through the browser.

I haven’t had any errors and the registration process has been really smooth. All email messages have seemed to go through including the Batch message.

If I have any updates I will come back to note them.


Tony

  • Support Staff

March 17, 2021 at 3:23 am

I am marking this as a topic I am going to come back to. I have a multisite install (April of 2020 on WP Engine, not sure when ‘new’ system started)

As of WordPress 3.5+ if you set up a Multisite network it will use the ‘new’ location /wp-content/uploads/sites/x

If the network was set up before then it uses /wp-content/blogs.dir/x and links go to {domain}/files/, the request is then processed via PHP to find the correct file and output.

Sounds like you are likely on the ‘new’ system.

It went through the process and looked to generate the csv file, it just didn’t give me the option to download or download through the browser.

Did it go to a 404 page or just not download?

Using Chrome? Retest with another browser, does it work then?

HTTPS or HTTP?

Viewing 24 reply threads

The support post ‘Registrations – Register and Export’ 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