propelorm/Propel — pull request #287 by fzaninotto (2012-02-13 10:45:21+00:00)
Title: Update the exception thrown by findOneOrCreate() when used with a join.

When using a join() (or a useXXXQuery()) on a query, and then terminating with
findOneOrCreate(), Propel used to throw a non-explicit exception only in the case
where there was no result found:

PropelException: 'author.FIRST_NAME' could not be found in the field names
of type 'colName'. These are: Array
...

The problem is that Propel cannot set the foreign key value, as the main
query uses a join and not a subquery. So Propel *should* indeed throw an
exception, but it should explain what to do more clearly:

PropelException: findOneOrCreate() cannot be used on a query with a join,
because Propel cannot transform a SQL JOIN into a subquery.
You should split the query in two queries to avoid joins.

This exception is now also thrown when the query has a result, to help spot
the problem during development (and not in production).

Fixes #261.