Skip to content

sfPropelMigrateTask: returns invalid value when there is nothing to migrate #153

Merged
merged 2 commits into from Aug 2, 2012

3 participants

@rozwell
rozwell commented Jul 31, 2012

Tasks returns null on success so we can identify there was an error:

<?php
$task = new sfPropelMigrateTask($this->dispatcher, new sfFormatter());
if($task->run() !== null){
  // ooops! en error occurred!
}

But sfPropelMigrateTask returned false not only on error but even when there was nothing to migrate.
I believe it's not an error so simple change false to null fixes this issue.

@travisbot

This pull request fails (merged d441adfe into 89779d0).

@travisbot

This pull request passes (merged e58c43b into 89779d0).

@willdurand
Propel member

Why don't you return true then?

@travisbot

This pull request passes (merged 2592a64 into 89779d0).

@rozwell
rozwell commented Jul 31, 2012

Makes sense, I just returned what other tasks did... (just checked and they return nothing actually and null is assumed) changed to true for all 3 sfPropelMigrate tasks.

And description of sfTask::run() is not too consistent with what tasks really returns.

Returns:
Type:        integer
Description: 0 if everything went fine, or an error code
@willdurand
Propel member

Well, that's right...

@willdurand
Propel member

Anyway, let's merge this PR.

@willdurand willdurand merged commit 67a3936 into propelorm:master Aug 2, 2012

1 check passed

Details default
@willdurand
Propel member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.