Hans Lellelid | 22 Aug 2007 19:49

Re: getDefaultValueString($column) usage in r686

Thanks for the report Tomasz.  I haven't encountered this yet
(weird...).  I'll check into it ASAP.

Thanks,
Hans

Tomasz P. Kotecki wrote:
> Guys,
>
> I've just checked out propel 1.3 from subversion (up to r686) and the
> change to PHP5ComplexObjectBuilder resulted in a lot of warnings like
>
> "PHP Warning:  Missing argument 1 for BaseObjectOne::setObjectTwoId()..."
>
> I investigated a bit and found out that the warning happens when the
> column is not required (therefore, the default value is null, but not
> string "null") and so the code that looked like:
>
> <code>
>         public function setObject(Object $v = null)
>         {
>                 if ($v === null) {
>                         $this->setObjectId(NULL);
> </code>
>
> looks like this:
>
> <code>
>         public function setObject(Object $v = null)
>         {
>                 if ($v === null) {
>                         $this->setObjectId();
> </code>
>
> Note the lack of NULL in the setter. Also note that the signature of
> setObjectId() does not have a default null value, eg.
>
> <code>
>         public function setObjectId($v)
> </code>
>
> So it's either the signature which should allow for it, or the
> getDefaultValueString() method should return 'null' in this case
> (which seems to have other implications), or that method is
> incorrectly used in the first place.
>
> P.S. While we're at it, could you create a svn tag that points to some
> reasonably up-to-date propel 1.3 version, so that there's some default
> to revert to if a bug appears in new revision? Right now we have to
> manually revert the change. That would be very handy, especially since
> we're using 1.3 on our production servers.
>

Gmane