Page MenuHomePhabricator

combobox pulldown lists options for last pulldown for every instance
Closed, ResolvedPublic

Description

As of today, I cannot change the term of a course. I can enter a new value, but it does not get saved upon Submit.

Also, the pulldown that should list term values in use by other courses instead lists the values for "Course level". The "Field of study" pulldown lists the course level values too. (As does the "Course level" pulldown, as expected.)


Version: master
Severity: major

Details

Reference
bz45506

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 1:32 AM
bzimport set Reference to bz45506.

Where are you seeing this exactly? Is this happening for all courses? And is it still happening?

Created attachment 11871
example of the problem

It's still happening, on all the en.wikipedia courses. Here's a screenshot I just took.

Attached:

Screenshot_from_2013-03-01_11:32:57.png (1×1 px, 152 KB)

Bizarre... I changed the term value from "testing" to "testing!" on https://en.wikipedia.org/wiki/Education_Program:Example_University/Example_Course_%282013_Q1%29

Saved it correctly, as it is showing up when viewing the course page itself.

Code on master for the edit page also looks correct, and is behaving correctly for me.

No clue what's going on...

Hmm... I just successfully changed the term back to Testing on that course. But I cannot change the term on this page: http://en.wikipedia.org/wiki/Education_Program:University_of_San_Francisco/Environmental_Law_(Spring_2013)

(It should be changed to "2013 Q1", along with the rest of the "Spring 2013" courses."

And the pulldowns were still wrong for example course, as well.

wtf... That is so really odd!

You cannot change it to "2013 Q1", though other things appear to work. Currently at "2013-Q1"...

I suspect something is wrong with the db state... Guess having a script to rebuild all denormalized storage would be useful

Adding Ori: any ideas about this bug?

Change 76729 had a related patch set uploaded by Ragesoss:
Change variable name to fix pulldown prepopulation: bug 45506

https://gerrit.wikimedia.org/r/76729

Change 76729 abandoned by Ragesoss:
Change variable name to fix pulldown prepopulation: bug 45506

Reason:
This doesn't fix the problem.

https://gerrit.wikimedia.org/r/76729

In investigating the pulldown forms, I found that it always populates options for the three "combobox" pulldown forms with the correct options for the last one on the page.

I also note that the inline HTML for these pulldowns seems to correct (that is, the options for the last entry don't get repeated for the others), so I guess it's a CSS-related problem with the last one overwriting the others?

Here's what the HTML looks like (with both showing the second set of options when rendered on-wiki):

</td></tr><tr class="mw-htmlform-field-EducationProgram\HTMLCombobox ep-combobox-tr"><td class="mw-label"><label for="mw-input-wpitem-field">Field of study</label></td><td class="mw-input"><select name="wpitem-field" id="mw-input-wpitem-field" class="ep-combobox-tr"><option value=""></option>
<option value="literature" selected="">literature</option>
<option value="math">math</option>
<option value="science">science</option></select>

</td></tr><tr class="mw-htmlform-field-EducationProgram\HTMLCombobox ep-combobox-tr"><td class="mw-label"><label for="mw-input-wpitem-level">Course level</label></td><td class="mw-input"><select name="wpitem-level" id="mw-input-wpitem-level" class="ep-combobox-tr"><option value=""></option>
<option value="advanced" selected="">advanced</option>
<option value="intermediate">intermediate</option>

The problem seems to be with the ep.combobox.js, but I don't understand it well enough to figure out where it goes wrong.

https://github.com/wikimedia/mediawiki-extensions-EducationProgram/blob/master/resources/ep.combobox.js

I've filed a separate bug for the "term cannot be changed" part of this bug: bug 55568.

This bug is now for just the combobox pulldown issue.

andrew.green.df wrote:

This bug does show up in a fresh MediaWiki-Vagrant install with the education role enabled.

To reproduce:

  • Add an institution.
  • Add a course.
  • Edit the course you added.
  • On the edit page, open a pulldown list for Course Name, Academic Term or Field of Study.

Change 89881 had a related patch set uploaded by AndyRussG:
Fix combobox options bug

https://gerrit.wikimedia.org/r/89881

andrew.green.df wrote:

I haven't tested this patch outside the Vagrant environment. All it does is revert a small mistake inserted here:

http://git.wikimedia.org/blobdiff/mediawiki%2Fextensions%2FEducationProgram/05679c1cf13bf19b66e4bf9a39192ea68d258873/resources%2Fep.combobox.js

Change 89881 merged by jenkins-bot:
Fix combobox options bug

https://gerrit.wikimedia.org/r/89881

andrew.green.df wrote:

Dump of EP extension-related DB table replicas for English Wikipedia

Attached: