Last modified: 2013-10-21 15:51:28 UTC
Branching this off from bug 45506. Some values are not saved for the "Term" field when a course is edited and saved. For example, in the en.wiki example course, trying to change the term to "Fall 2013" will result in a new history entry, but the new term value will not be saved. Some values save normally, however. https://en.wikipedia.org/wiki/Education_Program:Example_University/Example_Course_%282013_Q1%29
This bug does *not* show up, or at least not right away, in a fresh MediaWiki-Vagrant install with the education role enabled. This is what I did to try to reproduce it: - Add an institution. - Add a course. - Edit the course. - Change the term. - Save the changes. My guess is that somewhere there is a bug (or there are bugs) that make the database inconsistent in some way. The bug(s) may or may not be in the code for modifying terms, may even occur only in rare situations, and have given us inconsistent data on the live site. This inconsistency could be what causes the specific issue documented here, and maybe other problems, too (like this one: https://bugzilla.wikimedia.org/show_bug.cgi?id=43782). If this is what's happening, then maybe the best approach would be to first check for inconsistencies in the tables used by this extension on the live site(s), fix them (manually or semi-automatically), and try to figure out what caused them in the first place. Any comments or suggestions on how to proceed would be greatly appreciated!!!
Here's a dump of the recent DB tables related to this extension for English Wikipedia. https://bugzilla.wikimedia.org/attachment.cgi?id=13519
Strangely, all of a sudden I am able to change the term of the example course: https://en.wikipedia.org/wiki/Education_Program:Example_University/Example_Course_%282013_Q1%29 That didn't work a few days ago. I was also able to add a new course and change the term: https://en.wikipedia.org/wiki/Education_Program:University_of_Wikipedia/Another_Test_Course
Correction: term can't be changed to a term that is already used with another course. For example, I can't change the Example Course's term to Fall 2013.
Reproduced successfully, in a fresh MediaWiki-Vagrant install with the education role enabled, like so: - Add an institution. - Create a course for that institution. - Go back to the page of the institution. - Create a second course with a different term. - Once the second course has been created, click on the edit tab. - Try to change the term to the same value as the term for the first course. And... voilà! Your term does not change correctly! Conclusions so far: - This is not a DB bug, but a JS bug: when it occurs, the term value is incorrect in the HTTP post sent to the server. - It manifests itself when the new value for the term *is* among the values mentioned by the <option> children of the <select> element for setting the term. (Thanks, Sage, for the tip leading to this.)
This JS patch https://gerrit.wikimedia.org/r/89881 submitted for https://bugzilla.wikimedia.org/show_bug.cgi?id=45506 appears to fix this bug, too, at least following the procedure for reproducing it described above! So it looks like they were a single bug after all!