Open tmack8001 opened 7 months ago
Looking through issues I expected this url to work, but it is giving me a 404 as an anonymous user and logged in entrant to the competition.
Here is a managed site that gets a page not found error - https://laxlagers.brewingcompetitions.com/output/export.output.php?section=entries&go=csv&filter=winners
Related / original feature request:
https://github.com/geoffhumphrey/brewcompetitiononlineentry/issues/58
Found the path for the HTML results, but that still requires the parsing of a Dom that could change and/or human copy and pasting results. Both of which are brittle.
Having a similar url for CSV would be ideal
But this path doesn't work likely due to lack of a CSV formatter in output.inc.php
Hi @tmack8001 and thanks for reporting. In reality, no CSV exports were ever intended for just anyone to access directly via a URL unless a) the user is authenticated and b) their user level is Admin. It was an oversight on my part not to provide robust checks for this prior to the code being executed. The next version will have those checks in place with a 403 redirect if the user does not have sufficient authorization.
The HTML link you provided above works because it is able to be downloaded directly from the site home page after results are published - no authentication is needed to perform the download. This is also true for the PDF version of those results.
I'm not able to export CSV... or at least I don't think so.
Or maybe that is why the Server Error 500 is being thrown on the self-hosted version linked above?
I only stumbled upon this url format due to trying to find a way to export medal (public winner information only) in a more machinable format than parsing HTML or PDF documents.
If what you are stating is correct, I haven't gotten into the weeds of the code too much myself... then I would like to request essentially the same functionality that https://github.com/geoffhumphrey/brewcompetitiononlineentry/issues/58 was requesting (but I can't find it - or was the export built only intended for competition admins to run vs being a 3rd exposed download format for the Winning Entries and Best of Show Winners that are publicly posted by many competitions?
That report referenced in #58 was only intended for Admins to generate since it contained more personally identifying data points other than name and club. If you're a top-level admin of that installation, it's available at Admin Dashboard > Data Exports > Participant Data (CSV) > Winners: Limited Data. Otherwise, you would need to reach out to one and see if they'll get you that export.
That said, I don't see an issue with allowing a CSV export of those two reports to be publicly available with data points that are identical to the web version and HTML/PDF downloads (participant first/last name, entry name, style, club). It could be generated when a user selects an CSV-filetype icon from the publicly posted results page:
Yeah, that makes sense. Not after scores or emails, etc. But rather a more script friendly approach to collecting all medals for my club mates. Today it is a copy/paste pasta into Google sheet. Was thinking of parsing the DOn structure, but even that I don't want to have a future BCOEM release break cause you refactored or updated the layout design.
I think everything is in place to do this. As I'm sure you have more important things I can look at contributing this, though I haven't got a local dev environment setup either.
For the CSV we would need to make sure to remove all formatting of the brewer name (no new line for co-brewer and remove the MHP badge).
For co-brewer I could see arguments either way being included in the name or separated 🤔 being separated allows for the most flexibility of consumers of this data.
For MHP definitely a separate column, could see the same for AHA member number but that isn't publicly exposed best I can tell... Whereas MHP is, not the value specifically but the fact they participate.
The CSV format would need table information as well. Earlier I mentioned competition name and date, but in thinking on this more that data is simply metadata of the competition and not the winners list so wouldn't be needed for this user story.
Adding an enhancement tag to this one for future consideration.
Verify the Following Reporting About the Latest Version? Maybe
Searched Issue Reports for Bug? Yes
Reviewed the Good To Know Issue Reports? Yes
BCOE&M Info Version: 2.6.2 Installation URL: https://www.dchbcompetition.com Hosted Installation? Unknown
Describe the Bug A clear and concise description of what the bug is.
To Reproduce Steps to reproduce the behavior:
Expected Behavior Export CVS of winners
Server Environment
Additional Context I'm a participant and not a competition staff member so have no insights to how this installation is setup just that a url I've seen and have gotten to work on cloud version of BCOEM to work doesn't work here.