Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 2.6.2: Export CSV winners fails with Server Error #1513

Open
tmack8001 opened this issue Mar 25, 2024 · 8 comments
Open

Version 2.6.2: Export CSV winners fails with Server Error #1513

tmack8001 opened this issue Mar 25, 2024 · 8 comments
Labels
enhancement Suggestion for future enhancement.

Comments

@tmack8001
Copy link
Contributor

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:

  1. Go to https://www.dchbcompetition.com/output/export.output.php?section=entries&go=csv&filter=winners
  2. See server error 500 occurs with no information

Expected Behavior
Export CVS of winners

Server Environment

  • PHP Version: unknown
  • MySQL Version: unknown
  • Other Info: unknown

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.

@tmack8001 tmack8001 added the enhancement Suggestion for future enhancement. label Mar 25, 2024
@tmack8001
Copy link
Contributor Author

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:

#58

@tmack8001
Copy link
Contributor Author

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.

https://laxlagers.brewingcompetitions.com/includes/output.inc.php?section=export-results&go=judging_scores_bos&action=download&filter=default&view=html

Having a similar url for CSV would be ideal

https://laxlagers.brewingcompetitions.com/includes/output.inc.php?section=export-results&go=judging_scores_bos&action=download&filter=default&view=csv

But this path doesn't work likely due to lack of a CSV formatter in output.inc.php

@geoffhumphrey
Copy link
Owner

geoffhumphrey commented Mar 25, 2024

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.

@geoffhumphrey geoffhumphrey removed the enhancement Suggestion for future enhancement. label Mar 25, 2024
@tmack8001
Copy link
Contributor Author

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?

image

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 #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?

@geoffhumphrey
Copy link
Owner

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:

image

@tmack8001
Copy link
Contributor Author

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.

@tmack8001
Copy link
Contributor Author

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.

@geoffhumphrey geoffhumphrey added the enhancement Suggestion for future enhancement. label Apr 7, 2024
@geoffhumphrey
Copy link
Owner

Adding an enhancement tag to this one for future consideration.

@geoffhumphrey geoffhumphrey removed the enhancement Suggestion for future enhancement. label Jun 28, 2024
@geoffhumphrey geoffhumphrey added the enhancement Suggestion for future enhancement. label Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Suggestion for future enhancement.
Projects
None yet
Development

No branches or pull requests

2 participants