Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
forms system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
8 Jun 2015 at 10:18 UTC
Updated:
19 Jul 2016 at 04:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
klausiPatch attached.
Comment #2
klausiDrupal 7.36 actually.
Comment #3
rajab natshahTesting too :)
Not sure. If we are going to have this in 7.38 .
we had this from #2380053
Comment #4
ckngPatch #1 is working for bugs seen in Invite module, where the Invite type entity body field is missing when it is hidden.
Comment #5
cilefen commented@ckng Can you please review it so it can be committed?
Comment #6
ckngPatch #1 is reviewed and working as described.
Comment #7
klausiCool, so the next steps is to write tests for this.
Comment #8
pwolanin commentedI'm not sure I understand the bug - the problem is that NULL input is cast to empty string which is set?
Comment #9
ckngThe issue is the input is not null, has actual default value, just hidden. So the function returns empty when it should be the default value of the hidden control.
Comment #10
n_vashenko commentedHi, i'm getting the same bug. Solution in #2 works well
Comment #11
David_Rothstein commentedLet's see if a test was added when this was fixed in Drupal 8. If so, we can backport that. If not, I'm tempted to say we should just commit this to Drupal 7 also (since it fixes a regression) and then have a followup issue to write tests for both Drupal 7 and Drupal 8.
Comment #14
David_Rothstein commentedOK, the answer is that Drupal 8 does test this - Drupal\Tests\Core\Render\Element\TextareaTest.
Looks like a unit test only which for an issue like this is not quite as useful (by itself) compared to actually testing an actual practical effect, but it's better than nothing and I think backporting that would be good enough.
Comment #15
deanflory commentedPatch "form-textarea-value-2502263-1.patch" (#1) when applied to D7.42 deletes includes/form.inc entirely.
Comment #16
maximpodorov commented@deanflory, the patch is correct. You make something wrong.
Comment #17
deanflory commentedThanks maximpodorov, I think you're right since it happened to another patched file the other day as well. New Mac OS El Capitan. Not liking it. Haven't tried this again though.
Comment #18
Anonymous (not verified) commentedThe patch from #1 works for me with the latest Drupal. RTBC.
Comment #19
klausiTests are missing.
Comment #20
hgoto commentedFollowing David_Rothstein's guide, I wrote a test for the patch #1 with unit test.
To confirm that the test works well, I'd like to upload patches with and without code fix.
Comment #23
David_Rothstein commentedI queued these for retesting; the testbot seems to be having a bad day.
Comment #28
David_Rothstein commentedOh wait, the failure is real. Clicking through to the test results at https://dispatcher.drupalci.org/job/default/163462/console the patch has a syntax error:
Comment #29
hgoto commented@David_Rothstein, thank you for your reaction. I see... To check it, I created a new Drupal instance with the latest 7.x branch and applied the patch #20. What is strange is I can see the tests works without syntax error after applying the patch... Could anyone test the patch with simpletest? Or should I requeue the auto test again?
Perhaps, I may be wrong. I tested them with both admin UI and the following command:
Is something wrong?
Comment #30
klausiI think list() in foreach does not work in older PHP versions.
Comment #31
hgoto commented@klausi, thank you very much. You are right. I didn't notice the point... I've fixed that point and will try again!
Comment #33
David_Rothstein commentedThe patch looks good, but we normally don't use
$var- also that makes the variable public, but there's no need for a public variable here (protectedwould be better).And in this case it's probably better just to define the variable locally inside the test method (if another method is ever added later, it wouldn't be likely to need access to this particular variable too).
I fixed that in the attached and also cleaned up the variable names a bit. I'm going to mark this RTBC pending the tests passing/failing as expected (though I will let someone else do a final review and commit it) since my changes are minor and it would be really nice to get this in and the regression fixed in the upcoming release.
Comment #34
David_Rothstein commentedComment #37
stefan.r commentedLooks OK to me
Comment #38
hgoto commentedThanks, @David_Rothstein. I see! I totally agree with you.
Comment #40
fabianx commentedCommitted and pushed to 7.x! Thanks!