website
website copied to clipboard
Wins page: Fix question marks appearing where apostrophes are expected
Overview
As developers, we want to make sure the website displays information correctly so that the information is accurate and our website looks professional. For this issue, we will figure out what is causing the apostrophes to change to question marks in the Google Apps Script and fix the problem.
Screenshot of problem: Question marks where apostrophes are expected

Details
The original submission by Janie Chen did not contain question marks in the Wins-form (Responses) Google Sheet. However, the question marks appear on the Wins page. The problem may come from the Google Apps Script that generates the _data/external/_wins-data.json and _data/external/wins-data.json because the question marks are seen in the json files.
Action Items
- [ ] Request access to the "HfLA website Admin" Google Drive by asking one of the technical lead(s)/merge team member(s)
- [ ] Make copies of files in the "HfLA website Admin" Google Drive in your own drive (for making code changes to Apps Script and for testing)
- [ ] Figure out what is causing the apostrophes to change to question marks in the Google Apps Script
- [ ] Fix the problem in your own copies of the Apps Script and in your own drive
- [ ] Check and test the changes in your own drive
- [ ] Before the changes are to be added to the production script, demo the code changes in your drive to the dev team leads
- [ ] Edit the production script with your code changes
- [ ] Check and test production script code changes work fine
- [ ] Reach out to the dev team leads and ask them to review the changes to the production script code
Resources/Instructions
Hi @JessicaLucindaCheng.
Please don't forget to add the proper labels to this issue. Currently, the labels for the following are missing: Size, Role
To add a label, take a look at Github's documentation here.
Also, don't forget to remove the "missing labels" afterwards. To remove a label, the process is similar to adding a label, but you select a currently added label to remove it.
After the proper labels are added, the merge team will review the issue and add a "Ready for Milestone" label once it is ready for prioritization.
Additional Resources:
@SAUMILDHANKAR @R-Tomas-Gonzalez
-
Did you want it so that any backend developer can take this issue and would need to just ask a technical lead for access to the wins submission Google Sheet?
-
I don't have access to the wins Google Sheet and don't know what the link for it is. Can one of you add it to the Resources section?
@SAUMILDHANKAR @R-Tomas-Gonzalez
Did you want it so that any backend developer can take this issue and would need to just ask a technical lead for access to the wins submission Google Sheet?
I don't have access to the wins Google Sheet and don't know what the link for it is. Can one of you add it to the Resources section?
- Tomas said just tech lead is fine
- I'm just going to leave out the resource because I don't have access to it nor a link for it.
@SAUMILDHANKAR Since the files needed to fix this issue are in the protected admin drive, should I restrict this issue to admins/leads that have access to the drive to work on? Or can it be open to other developers and they would just have to ask a lead for access (similar to how Matt wrote issue #2385)?
@JessicaLucindaCheng It can be open to other developers as well. (like Matt's issue). Thanks for bringing it up.
@SAUMILDHANKAR Since you are more familiar with Google AppScripts than I am. Could you review this issue for ready for milestone
? If it's not ready, please provide feedback as to what I need to change. Thank you.
@SAUMILDHANKAR Since you are more familiar with Google AppScripts than I am. Could you review this issue for
ready for milestone
? If it's not ready, please provide feedback as to what I need to change. Thank you.
@JessicaLucindaCheng Thanks for writing the issue. My suggestions:
- We could go for a shorter title like "Fix question mark error on Wins page" or something similar. I remember from our team meetings to make titles succinct.
- I would also suggest adding the following points as reminders in the action items (this might help avoiding accidental changes to the production script)
- make copies of files in the admin drive in their own drive (for making code changes to apps script and testing)
- demo of changes and recommendations to team leads recommended before the changes could be added to production script.
@SAUMILDHANKAR I really appreciate you taking the time to give me feedback on writing this issue. I made the requested changes, except I left the title more descriptive because I felt being descriptive and clear was more important than being super succinct. (Though I did shorten the title a bit.)
Please put a ready for milestone
label on if you think it's ready. Otherwise, let me know what else should be changed.
Hi @usaboo, thank you for taking up this issue! Hfla appreciates you :)
Do let fellow developers know about your:- i. Availability: (When are you available to work on the issue/answer questions other programmers might have about your issue?) ii. ETA: (When do you expect this issue to be completed?)
You're awesome!
P.S. - You may not take up another issue until this issue gets merged (or closed). Thanks again :)
Hi @ldaws003, thank you for taking up this issue! Hfla appreciates you :)
Do let fellow developers know about your:- i. Availability: (When are you available to work on the issue/answer questions other programmers might have about your issue?) ii. ETA: (When do you expect this issue to be completed?)
You're awesome!
P.S. - You may not take up another issue until this issue gets merged (or closed). Thanks again :)
Availability: Sunday 12:00pm - 5pm, Monday 3:00pm to 6:00pm, Tuesday 9:00am-5:00pm, and Wednesday 4:00pm-8:00pm ETA: Wednesday 5:00pm
Progress: Downloaded the files from the drive and will be going through Google App Script docs before trying to find the bug Blockers: N/A Availability: Monday 4:00pm to 7:00pm, Wednesday 2:00pm to 5:00pm, Friday: 5:00pm to 8:00pm ETA: Saturday
Progress: Read through documentation, will be searching for the bug solution Blockers: N/A Availability: Friday 8:00am-5:00pm, Saturday (all day), Sunday (all day) ETA: Sunday
Progress: Searching for the bug Blockers: N/A Availability: Thursday (all day), Friday 8:00am-5:00pm, Saturday (all day), Sunday (all day) ETA: Sunday
Progress: Searching for bug Blockers: N/A Availability: Saturday (all day), Sunday (all day) ETA: Sunday
@ldaws003
Please add update using the below template (even if you have a pull request). Afterwards, remove the 'To Update !' label and add the 'Status: Updated' label.
- Progress: "What is the current status of your project? What have you completed and what is left to do?"
- Blockers: "Difficulties or errors encountered."
- Availability: "How much time will you have this week to work on this issue?"
- ETA: "When do you expect this issue to be completed?"
- Pictures (optional): "Add any pictures of the visual changes made to the site so far."
If you need help, be sure to either: 1) place your issue in the developer meeting discussion column and ask for help at your next meeting, 2) put a "Status: Help Wanted" label on your issue and pull request, or 3) put up a request for assistance on the #hfla-site channel.
You are receiving this comment because your last comment was before Monday, December 19, 2022 at 11:16 PM PST.
Progress: Still trying to find the bug
Blockers: Can't find documentation on GHRequest and getting errors trying to run app script
Availability: Saturday (all day), Sunday (all day)
ETA: Sunday 10:00pm
Progress: Fixed Bug waiting to demo for dev team leads Blockers: None Availability: Saturday (all day), Sunday (all day) ETA: Sunday 10:00pm
Progress: Fixed Bug waiting to demo for dev team leads Blockers: None Availability: Monday - Friday 1:00pm to 5:00pm ETA: Thursday 10:00pm
Developer demonstrated his code and showed that the wins-data.json file replaced the question marks with apostrophes. We double checked with diffchecker.com to make sure there were no unintended removals or additions. The production code was updated but cannot run due to a "bad credentials" message as shown in the log below:
I expect this may be due to the github authorization token expiration which we should try to fix so we can review the Wins page on the published website and see if it is working. Then we can close this issue without PR.
@ldaws003
Please add update using the below template (even if you have a pull request). Afterwards, remove the 'To Update !' label and add the 'Status: Updated' label.
- Progress: "What is the current status of your project? What have you completed and what is left to do?"
- Blockers: "Difficulties or errors encountered."
- Availability: "How much time will you have this week to work on this issue?"
- ETA: "When do you expect this issue to be completed?"
- Pictures (optional): "Add any pictures of the visual changes made to the site so far."
If you need help, be sure to either: 1) place your issue in the developer meeting discussion column and ask for help at your next meeting, 2) put a "Status: Help Wanted" label on your issue and pull request, or 3) put up a request for assistance on the #hfla-site channel.
You are receiving this comment because your last comment was before Monday, January 16, 2023 at 11:16 PM PST.
Progress: Displayed solution, code was successful but there was an unexpected error not on my part, waiting for response. Blockers: None Availability: Just waiting ETA: N/A
Tried to run the code after the authorization token was updated. I am not entirely sure how the workflow works for the Google Apps Script issues, because it seems that after running this code, it pushed a commit directly into PR #3024, and from the looks of it, it has indeed fixed the issue of question marks showing up where the apostrophes are supposed to be. Since the most recent commit displays the expected outcome, @ldaws003 I think you should be safe to go onto your next issue if you'd like! Nice job! I'll talk with @hackforla/website-merge regarding PR #3024 to see what we need to do about pushing the code into the codebase. It may have a few dependencies that need to be satisfied before we can merge it.
We'll leave this issue open until we determine the next step.
OK. For the fix the only line of code that I had to change was line 93. I changed it from this
const encodedArrayData = Utilities.base64Encode(
${cleanedAndFormattedArrayData});
to this
const encodedArrayData = Utilities.base64Encode(cleanedAndFormattedArrayData, Utilities.Charset.UTF_8);
The encoding of the data was the problem. The second parameter tells the function what the encoding of the input is, and it seems that the google sheets data is in UTF-8. The google documentation doesn't state what charset is used when you don't use the second parameter.
@ldaws003
Please add update using the below template (even if you have a pull request). Afterwards, remove the 'To Update !' label and add the 'Status: Updated' label.
- Progress: "What is the current status of your project? What have you completed and what is left to do?"
- Blockers: "Difficulties or errors encountered."
- Availability: "How much time will you have this week to work on this issue?"
- ETA: "When do you expect this issue to be completed?"
- Pictures (optional): "Add any pictures of the visual changes made to the site so far."
If you need help, be sure to either: 1) place your issue in the developer meeting discussion column and ask for help at your next meeting, 2) put a "Status: Help Wanted" label on your issue and pull request, or 3) put up a request for assistance on the #hfla-site channel.
You are receiving this comment because your last comment was before Monday, January 30, 2023 at 11:17 PM PST.
@ldaws003
Please add update using the below template (even if you have a pull request). Afterwards, remove the 'To Update !' label and add the 'Status: Updated' label.
- Progress: "What is the current status of your project? What have you completed and what is left to do?"
- Blockers: "Difficulties or errors encountered."
- Availability: "How much time will you have this week to work on this issue?"
- ETA: "When do you expect this issue to be completed?"
- Pictures (optional): "Add any pictures of the visual changes made to the site so far."
If you need help, be sure to either: 1) place your issue in the developer meeting discussion column and ask for help at your next meeting, 2) put a "Status: Help Wanted" label on your issue and pull request, or 3) put up a request for assistance on the #hfla-site channel.
You are receiving this comment because your last comment was before Monday, February 6, 2023 at 11:17 PM PST.
Issue has been corrected. Closing this issue.
Hi @ldaws003, thank you for taking up this issue! Hfla appreciates you :)
Do let fellow developers know about your:- i. Availability: (When are you available to work on the issue/answer questions other programmers might have about your issue?) ii. ETA: (When do you expect this issue to be completed?)
You're awesome!
P.S. - You may not take up another issue until this issue gets merged (or closed). Thanks again :)