Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
base system
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
14 Dec 2007 at 05:27 UTC
Updated:
11 Sep 2009 at 21:30 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
triclops commented+1
Comment #2
sammys commentedBumping status...
Comment #3
Anonymous (not verified) commentedupdated patch to account for code committed here.
Comment #4
pancho+1. This looks very good.
Comment #5
Anonymous (not verified) commentedBump.
Patch still applies cleanly to head. Is there a reason this is not going in other than time?
Comment #6
Anonymous (not verified) commentedUpdated patch to keep up with HEAD.
Comment #7
chx commentedReason: we need people to test this.
Comment #8
cburschkaPatch broken by a trivial conflict. Here's a re-roll.
As an aside, does this concept code actually work?
Because that's what this "avoid confusing the caller" code seems to do. Does (object) and (array) casting work in-place in spite of the assignment?
Comment #9
sammys commentedThanks for the reroll. :) PHP does work that way. Here is what happens when I execute your code above with PHP on the command line.
Comment #10
sammys commentedbumping to 6.1
Comment #11
yched commentedThis should be bumped to D7, actually.
Should be fixed there first, then backported
Comment #12
vladimir.dolgopolov commentedHere is the test for Simpletest module.
I cannot reproduce the situation here: http://drupal.org/node/207170 since drupal_write_record() generate a valid query for core shemas.
Comment #13
gábor hojtsy@Vladimir, how is a random name results in valid queries? Or do I misunderstand something here?
Comment #14
vladimir.dolgopolov commentedThe point is:
So if drupal_get_schema() fails (no schema found because of a random name) then drupal_write_record() won't convert "array" to "object" in any case.
Comment #15
bjaspan commentedI re-discovered this bug, applied the patch from this issue to D6, reviewed it, and it looks fine to me.
Vladimir's test case is currently sitting in this issue, not in a file anywhere. We do not yet have a plan for where to put test cases for individual bug fixes/issues. Once we figure that out, we can put his test case there.
Comment #16
gábor hojtsyCommitted to Drupal 6, still to be committed to 7!
Comment #17
dries commentedCommitted to CVS HEAD. Thanks.
I'm update the component to 'tests' so we can still write a test for this (if necessary).
Comment #18
bjaspan commentedI discussed this with Gabor yesterday. Vladimir already wrote a test case, posted in this issue. I wasn't sure where to put it in the filesystem. It's a test for a particular bug fix, in this case in the includes/ directory. Can we have includes/includes.test? Or should we create a directory of per-issue test cases like ./tests/200824.test? Or something else? we;re going to end up having a lot of "here's the test for the bug reported in issue #xyz" and we need a consistent strategy for handling them.
Comment #19
sammys commentedThanks for getting this committed everyone!
Comment #20
dropcube commentedTest for drupal_write_record() here: #353918: drupal_write_record writes empty string instead of empty serialized array