We have identified a following critical bug during our Czech Drupal translation sprint: Simply put - some string you translate will not save when you click Save changes button.
How to reproduce:
1) Open l.d.o in two different browser sessions (possibly under two different users), make a filter choice and make sure both filters are the same in both windows.
2) In both windows, go to a last page of the selection. You should be at page X.
3) In Window 1, go to previous page. You should be at page X-1.
4) In Window 1, translate last few strings and Save changes.
5) In Window 2, translate first string and Save changes. ->This string will not be saved
Why? Because the first string actually internally changed it's position to a different page after you save few strings in Window 1. I think this is a general problem with Drupal forms - when you submit a form and that form is not present on the page that loads after the submit, no submit hook is run.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | base_data_change_can-787068-9.patch | 4.33 KB | SebCorbin |
Comments
Comment #1
gábor hojtsyThis seems to be a side effect of how the form API works. Drupal checks whether the submitted form is valid, and it regenerates the base form structure for that. So if the underlying data changes, the form structure will change., and your data will not be accepted. We could maybe look into testing how form caching interacts with this validation/submission process, so we maybe can eliminate the form regeneration.
Comment #2
gábor hojtsyRetitled to be more specific as we now understand the problem.
Comment #3
gábor hojtsy#806758: Items come back without suggestion was submitted as a duplicate and has some similar details.
Comment #4
frans commentedSo translate sprints with l.d.o. are a no-go until this is solved!
Can it be solved by using indivdual forms per item instead of a page form? The position of a item is then not relevant anymore. I also feel that the proccess then is more natural... I don't like the way it works now, I hate to save twice. One time when you leave the field and then the whole page.
Comment #5
gábor hojtsyYou can still just use per-project filtering where there is much less chance of a form issue (but there is some).
Comment #6
wojtha commentedSimilar issues in other projects
#497206: Avoid search conflicts with other forms, use menu API instead of search_get_keys()
#614644: Forms attached to Apachesolr search results won't work
Ubercart.org #5089 Search result as teaser 'Add to cart' button doesnt work
Comment #7
palik commentedi created http://drupal.org/node/1299954 and it may be duplicate, but I'm not sure, check the symptoms and repair this please :)
Comment #8
SebCorbin commentedIt may be that we have still this issue on the 7.x-1.x branch, any way, the 6.x version is discontinued
Comment #9
SebCorbin commentedThe main problem is that the form is relying on pager to get the strings, when a form is submitted, the query is executed again to retrieve the sids.
That can cause race condition when another person (or another page) is submitted and has a lower page number.
I've attached a patch that fetch the sids submitted from
$form_state['input'](that I'm not proud of), but solves the problem. Given we have a limit of 50 strings per page, I've overcome the potential DDOS (even if it is authenticated form) by only allowing a chunk of 50 sids to be input by user.Comment #11
gábor hojtsySo while the limit param is validated, the string list may still be any length no? It would be great to chunk this with the limit or refuse the form if its over 50 (or over the limit that was validated) or something along those lines.
I am a bit wary to make this live honestly :/
Comment #13
SebCorbin commentedPushed a array_slice given the maximum limit we allow in the filter form.
The french team successfully tested this patch on staging.
Comment #14
gábor hojtsyDeployed to live. Thanks for the quick fix. :)