Page MenuHomePhabricator

Autoedit changes unintended form field
Closed, ResolvedPublic

Description

I've run across a nasty bug in Semantic Forms (2.5.1) while doing an autoedit via the API where the autoedit changes the first character of another Template field that was not part of the intended edit.

This is the autoedit command I'm executing (via python-simplemediawiki)

c = wiki.call({'action': 'sfautoedit', 'form': 'Book', 'target': title, 'Book[Cover]': 'Cover for ' + book['printouts']['Has Amazon ASIN'][0] + '.jpg'})

It is targeting this Form:

http://rwbookclub.com/wiki/Form:Book

The behavior is very odd. It does update the Book[Cover] field as intended, but it changes the value of any *dates* in the templates.

Here is an example diff:

http://rwbookclub.com/w/index.php?title=Wired_for_War:_The_Robotics_Revolution_and_Conflict_in_the_21st_Century&curid=884&diff=4584&oldid=4575

Note that "November" has been changed to "Povember" in all cases, including *other* templates.

It isn't always a P either, see this diff:

http://rwbookclub.com/w/index.php?title=Among_Others&curid=898&diff=4594&oldid=4592

"November" became "Aovember".


Version: unspecified
Severity: major

Details

Reference
bz41765

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 1:12 AM
bzimport set Reference to bz41765.

Additional information. I use this same autoedit capability on another wiki and had never seen this behavior with a timestamp being changed. So, I had a hunch. The only difference between those two forms was that this one had "restricted" set on the field that was getting changed.

So, I modified the form and removed "restricted" from the "Added on" field and this behavior went away.

http://rwbookclub.com/w/index.php?title=Fooled_by_Randomness%3A_The_Hidden_Role_of_Chance_in_Life_and_in_the_Markets&diff=4975&oldid=4973

Only happens with date fields that are set to restricted from what I can see.

Moving from Critical to Major since this only happens if the field is set to restricted.

This fix doesn't seem to have ever been committed back into the main release. I'm seeing the same problem again on another wiki using new code.

Is this still an issue with the latest dev version?

I think this should be fixed. Please re-open if this is still an issue.