Support #24643
openPrevent bad cuny.is values from being saved when editing CV using code editor
0%
Description
I found this outdated documentation about cuny.is functionality - https://help.commons.gc.cuny.edu/cuny-url-shortener/ - and am trying to update it.
The cuny.is/{membername} can be changed by editing the member's CV. I edited mine from "scottvoth" to "svoth." The display worked fine after the change, but the cuny.is link didn't work. I changed it back and it worked again.
Files
Updated by Marilyn Weber 4 days ago
I'm so excited! I can do this for you, Scott!
Updated by Boone Gorges 4 days ago
I think what Scott means is that changing your username in the CV editor should also change the cuny.is link, automatically, without requiring manual intervention. I believe I checked this at the time we built the CV editor, but it could be that something's broken. In fact, now that I think of it, I wonder if there's a Cloudflare firewall rule or something similar that prevents the Commons from calling the cuny.is API. I'll investigate.
Updated by Boone Gorges 3 days ago
- File Screenshot_2026-03-13_14-33-52.png Screenshot_2026-03-13_14-33-52.png added
- File Screenshot_2026-03-13_14-40-39.png Screenshot_2026-03-13_14-40-39.png added
- Status changed from New to Reporter Feedback
I've just tested this with my own account, and it seems to be working as expected.
I wonder if perhaps this is a problem specific to your test. I checked the cuny.is admin and there's an existing link cuny.is/svoth, which points to http://cdev.gc.cuny.edu/members/scottvoth/, created back in 2013 (!). So, from the point of view of the URL shortener software, that name is not available.
What's odd is that you were able to save the already-taken name in the first place. When I try to take an already-claimed URL, the CV editor (correctly) shows an error. See screenshot. Looking over the code, it's not supposed to let you save a short URL that has been rejected in this way https://github.com/cuny-academic-commons/cac/blob/master/wp-content/plugins/cac-cv-editor/blocks/src/cv-shortlink/index.js.
Can you test again and let me know if you're seeing the error message from the screenshot when you try to get 'svoth'? If not, can you open your developer console (F12) to the Network tab, and then filter by AJAX or XHR, and then see what happens when you enter 'svoth'? There should be a request to admin-ajax.php, and if you highlight it and click Request, you should see that it fired with action:cac_yourls_check, and on a successful rejection, the 'Response' tab should have 'code:0'.
Updated by scott voth 3 days ago
- File cuny-is-2.pdf cuny-is-2.pdf added
- File cuny-is.pdf cuny-is.pdf added
Hi Boone - I think the problem stems from my use of the code editor vs. the visual editor. When I use the visual editor I do get the error message. When I use the code editor, I am able to make the change and then the link doesn't work. Maybe this is an edge case, maybe not worth pursuing? See attached.
Updated by Boone Gorges 3 days ago
- Subject changed from Is it still possible to change https://cuny.is/{membername}? to Prevent bad cuny.is values from being saved when editing CV using code editor
- Status changed from Reporter Feedback to Assigned
- Target version set to 2.8.0
Ah, yes, that's almost certainly it. It's not designed to work properly with the code editor. I guess in that case there should be some server-side rejection so that the new value isn't saved. I'll take some time for an upcoming release to see how hard that is, but in the meantime we can chalk it up to being an edge case.