Posted: February 28, 2017 at 7:25 am
|
Hello, I’m trying to analyze the events by category, but I couldn’t find a way to add the event categories into the registrations download. Would there be a simple code to enable this? |
Hi there, Something like this: https://gist.github.com/Pebblo/09081bb43fa217b0e83060d151d3eda2 That will add an ‘Event Categories’ column to the csv and add any categories the event has assigned to it within there, the categories are current separated by a space which you may want to change. |
|
|
hi there, Thank you for the quick answer. It works, however creates a new problem: with some of the registrations, the author and the categories are pushed by a couple of cells to the right (so while most of them have the Author in AJ then category in AK, a few of them have the same info as of column AN and some of them as of column AS): I have already 2 other functions in the site specific plugin to add the language tag and the author name to the csv download. Maybe it’s because of how these 3 functions operate together? https://gist.github.com/altuno/bd583ae4f70354d0961adfa9be8f33ee |
Hmm, strange. I can’t see anything in my code that would cause that, it only happens with that additional function? I’ve updated my code to return null if no categories at set on the event rather than an space, please update and retest as I can not reproduce this. |
|
|
Hi Tony, I just finished testing each code to see what they will affect. It seems like the issue is not only due to your code, each code creates additional column shifts. Even when I take out all 3 codes (language (tags) / instructor (event author) / event category), there are some minor column shifts in the download. However as I add each code, each create different column shifts in different registrations for their respective columns. e.g.: No code: Column shifts in rows 1056, 1075, 1078 etc How can I proceed? |
Then the issue is not with any of the code you posted above, have you confirmed you have no other custom code hooking into the CSV? |
|
|
Why? The column shifts with no code are only about 6-7 rows in total, out of about 2500 rows. The additional codes create a lot of extra shifted rows. These 3 should be the only functions affecting the CSV, you can have a look at the full code in the site specific plugin here: |
It doesn’t matter that its only 6-7 rows, there shouldn’t be any, if your columns are shifting without customizations then additional columns will only make that problem worse. Is there anything different about the values shown in the rows that shift?
There’s no additional functions altering the CSV in that plugin, but have you confirmed nothing has been added anywhere else, for example the themes functions.php file? |
|
|
I did check this, I couldn’t find anything unusual in these rows. Anyway it all seems perfectly fine until the last column for all of the rows.
Yes, I anyway never touch the theme functions file, and the child theme functions file has only a few lines of code not at all related to EE4. There are some customizations in the events table template file under uploads/espresso/templates, could this have any impact? Otherwise I have no idea why this issue is happening. |
No, not unless your hooking into the CSV from those file which wouldn’t really make sense. Can you send me a copy of the CSV to support[at]eventespresso.com Important – please export a new CSV the site and do not open it within excel or similar before sending over. So download the CSV from the site and send that over without opening it up. The reason being is excel can change the formatting of the file, I need the version directly from the site. |
|
|
sure, just sent. |
Thank you. I have been able to reproduce this on a test site but the cause is unknown. It is not caused by the custom code adding the additional columns, they are a symptom rather than the cause. I’ve created a ticket for one of our developers to investigate this further. |
|
|
Hi, |
The support post ‘Event Category in the csv all registrations download’ 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.