Bug #1614
closedNon-CUNY Sign-Up Code Disappears After Creation
0%
Description
I've now used the non-CUNY sign up code tool twice. It's great. But I have noticed a strange bug: a certain period after the code is put up, people report that the code doesn't work. When I check the backend at that point, the entry for that code appears to have lost both the code itself and the group with which the code was associated -- both fields are blank. Maybe this is happening after someone successfully uses the code -- ie., after a successful use, it resets?
In both cases, I have re-entered the code and group, and it appears to stick after that.
Updated by Boone Gorges almost 13 years ago
- Status changed from Assigned to Hold
It's hard for me to see how this could happen, looking at the code. Next time it happens on the live site, will you let me know right away, before you fix it, so that I can look at the database?
Updated by Matt Gold almost 13 years ago
Sure, but it might be worth creating your own sign-up and seeing what happens to it -- I'm not completely sure these codes have been used before they've disappeared.
Updated by Boone Gorges almost 13 years ago
- Target version changed from 1.3.6 to 1.3.7
Updated by Boone Gorges over 12 years ago
- Target version changed from 1.3.7 to 1.3.8
Updated by Boone Gorges over 12 years ago
- Target version changed from 1.3.8 to 1.3.9
Updated by Boone Gorges over 12 years ago
- Target version changed from 1.3.9 to 1.3.10
Updated by Boone Gorges over 12 years ago
There appears to have been a change (in WP maybe? not sure) that caused the plugin not to show up in Dashboard menus. I doubt that this is causing the original problem in this ticket, but it's preventing me from doing proper testing. I've fixed these regressions in https://github.com/castiron/cac/commit/180a85dd4cd693b6a3ef79e67e8e37295401d609 and will attempt to do more thorough testing in the next cycle.
Updated by Boone Gorges over 12 years ago
- Target version changed from 1.3.10 to 1.3.11
Updated by Boone Gorges over 12 years ago
- Status changed from Hold to Resolved
After further examination, I think I found the culprit.
If you leave the post.php edit window open for a while (more than 2 minutes, by default), WP runs its autosave javascript, which in turn fires the `save_post` action. I'd been saving the custom post data (BP groups and signup code) on `save_post`. But WP's autosave is not aware of custom fields in the interface (which is IMO a glaring error, but anyway), with the result that my save method was detecting null values for these fields, in effect erasing them.
I've fixed this issue in https://github.com/castiron/cac/commit/2d7eb67c6ca601726c98c36d9b12b8dff06bc779 by not running my routine on autosave. I'm tentatively marking this issue as resolved. Please reopen if it happens again.