Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
language system
Priority:
Normal
Category:
Bug report
Assigned:
Issue tags:
Reporter:
Created:
5 Nov 2012 at 19:53 UTC
Updated:
29 Jul 2014 at 21:28 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
gábor hojtsyComment #2
schnitzel commentedattached a patch which fixes this issue: it does only save the strings if they are actually changed, not just a translation entered.
refactored the whole thing, as there where pretty confusing variable names.
Comment #3
schnitzel commentedxposting
Comment #4
attiks commentedPatch looks good, but don't we need a test?
Comment #5
gábor hojtsyYes, definitely need tests.
Comment #6
gábor hojtsyAs per coding standard this would need to be "elseif" and on a separate line.
Comment #7
-enzo- commentedFirst initial version of patch for Simple Test
Comment #8
schnitzel commentedwill finish these tests.
Comment #9
gábor hojtsyWoot, thanks!
Comment #10
-enzo- commentedAdding Issue summary template
Comment #11
-enzo- commentedComment #12
schnitzel commentedComment #13
schnitzel commentednew version:
- fixed "else if" issue.
- added Tests to check that strings are only saved and marked as customized if they are actually changed.
Also patch with tests only, which should fail.
Comment #14
gábor hojtsyThe proposed patch looks good, I only found one condition I think should be tested and some minor code fixes:
Should be shortened to one line if possible :) Eg.
"Tests that only changed strings are saved customized when edited."
"Query strings..." - no need to talk 3rd person here.
without
I would add a test that it actually shows up on a separate search for customized strings specifically.
"a string in the same format is created" instead of "the same strings are created", since we are only creating one string, right? :)
I can see that this is broken down to an if() and elseif() clause to delineate the two conditions. So maybe adding more docs to the second one, eg. "Newly entered translation." or somesuch would help underline the need for the two blocks of code (instead just one big condition).
Comment #15
smiletrl commentedSteps to reproduce
Comment #16
smiletrl commentedhmmm, did I missing something. After I applied this patch, this problem remains. Maybe I need a refresh install to test this?
Comment #17
gábor hojtsy@smiletrl: well, the tests were not complete above either, so the fix might not be complete either. I don't think you would need a fresh install, but trying again never hurts :) Your steps to reproduce seem spot on.
Comment #18
gábor hojtsyBTW I believe @Schnitzel does not have capacity to work on this, so unassigning to make it evident that it is free to take. Need people to work on this :)
Comment #18.0
gábor hojtsyupdate Issue with report template
Comment #18.1
yesct commentedUpdated issue summary remaining tasks to make it easier for people to find a part of the issue to do
Comment #19
yesct commentedSome of the remaining tasks are novice, some medium (like reviewing the tests to see if they are complete). The tasks do not have to be done in order. This is a good one for a couple people to jump into.
Comment #19.0
yesct commentedfix html
Comment #20
yesct commented#13: 1832614-13.patch queued for re-testing.
Comment #21
rkjha commented#13: 1832614-13.patch queued for re-testing.
Comment #22
rkjha commented#13: 1832614-test-only-will-fail.patch queued for re-testing.
Comment #24
rkjha commented#7: 1832614-test.patch queued for re-testing.
Comment #25
rkjha commented#2: 1832614-1.patch queued for re-testing.
Comment #25.0
rkjha commentedUpdated issue summary to help novice people identify what they can do.
Comment #26
smiletrl commentedSince the past patch failed automated test, I guess a better idea is to seperate the test code from fix code.
This attachment is devided from #13 only to fix the problem, not including test code, and it's been updated according to suggestions at #14.
To test the patch, we will need another fresh installment of drupal8, because it won't have effect on existing records in db. That's why I didn't see it work last time.
Let's see will this patch make drupal robot happy:) Will work on test code later.
Comment #27
gábor hojtsyWell, the earlier tests looked pretty complete, so I think it is better to start looking if the test had issues, or it properly identified a bug with the fix itself. As opposed to starting to write a new test from scratch... Thanks for picking this up!
Comment #28
smiletrl commentedThere're some bugs with the test code.
Firstly, before the last two test assertText, there's no search/filter action, like
There should be search/filter action, e.g,
after saving strings and right before assertion.
Secondly, in this issue's case, we need to create more than one translated and uncustomized strings(manually, we import .po file to do this), update one of them as customized, and then search the customized strings. I think we need assertText to find that customized string and assertNoText to make sure uncustomized strings are not saved as customized. This is also what suggested in #14.
Let me try to fix this:)
Comment #29
smiletrl commentedComment #30
smiletrl commentedThe first patch is the test code, and of course it will fail. It's been updated according to #29/#28, although there're some tweaks.
In this issue, when save unchanged translation strings, these strings are saved as customized. So
will fail. And the next search will fail too, because this search fails.
interdiff-13-29.txt indicates changes of test code between #13 and #29/#28.
The final patch is the whole patch, including fix code and test code. All these patches work fine in local tests. So, let's see will they satisfy drupal testbot~
Comment #31
gábor hojtsySending for tests. @smiletrl: thanks!
Comment #32
gábor hojtsyThe changes look good to me and testing the fixed functionality properly. Thanks!
Comment #33
dries commentedLong variable names, but committed to 8.x. Thanks.
Comment #34
schnitzel commented@smiletrl thanks for jumping in! awesome :)
Comment #35
gábor hojtsyWoot, thanks!
Comment #36
gábor hojtsy@smiletrl: thanks again! If you are looking for tasks on a similar scale #1853720: Hide language selection option is backwards or #1869328: Restore simplicity of language list are very good candidates :) Thanks for helping out :)
Comment #37.0
(not verified) commentedUpdate the reporducing steps with new drupal 8 release.