When #243532: Catch notices, warnings, errors and fatal errors from the tested side is applied, the ActionsConfigurationTestCase generates the following notices when submitting admin/settings/actions/configure/[action-id]:

Exception Warning query.inc 66
array_fill(): Number of elements must be positive
Exception Warning query.inc 67
implode(): Bad arguments.

Comments

damien tournoud’s picture

boombatower’s picture

Assigned: Unassigned » boombatower
Status: Active » Needs review
StatusFileSize
new3.44 KB

Talked with chx and decided upon following.

boombatower’s picture

StatusFileSize
new1.66 KB

Fixed else if -> elseif

and got rid of stuff for other patch.

webchick’s picture

From #drupal:
* else if should be elseif
* count() is slow; just elseif ($this->defaultFields) will do.

boombatower’s picture

StatusFileSize
new2.1 KB

Removed count() from both for consistency.

and fixed tabbing in pgsql file.

webchick’s picture

Component: base system » database system
Status: Needs review » Fixed

Confirmed all database tests pass, code looks good, although it'd be nice for Crell to have a look at it when he's around. However, we need to get those tests passing again. :)

Committed to 7.x. Thanks!

Crell’s picture

Status: Fixed » Needs work

How were we even getting this? Was this caused by the insertFields array being empty? Right now calling InsertQuery::execute() without fields is a bug in the calling code. Having it insert a default row instead is NOT the way to fix it. Having it not insert at all is the way to fix it, or else throwing an exception.

Unless I'm misunderstanding this issue entirely we just traded one bug for another.

webchick’s picture

Status: Needs work » Active

Ok. Rolled back that patch. Let's try again. :)

drewish’s picture

Crell’s picture

Hm, could be, drewish. That's probably how we're generating the case that is causing this error. And #321100: Empty insert statements should fail gracefully (which no one even told me about, bah!) seems to be trying to fix it, sort of.

chx’s picture

Status: Active » Needs review
StatusFileSize
new484 bytes

OK, so I copied

  db_insert('simpletest_test_id')->useDefaults(array('test_id'))->execute();

simpletest, Dave reid suggested it in sister issue anyways. I like this solution as it does not require mucking with the DB layer for a fringe edge case.

webchick’s picture

Status: Needs review » Fixed

Crell pointed out in #drupal that this is the same construct SimpleTest uses for a similar purpose, so the fix seems correct to me.

Confirmed that this fixes the problem, so committed. We should now be down to 0 test failures again. YEE HAW! :)

hswong3i’s picture

webchick’s picture

Yes, sorry about that. This issue was technically the duplicate. We just were trying really quickly to get the tests passing again, and since this one was linked from the original issue I found this one first. :\

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.