New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Versionable behaviour with ENUM fields #35

Closed
StormySan opened this Issue Aug 12, 2011 · 1 comment

Comments

Projects
None yet
2 participants
@StormySan

StormySan commented Aug 12, 2011

There appears to be a bit of an issue with the Versionable behaviour and ENUM type fields.

As ENUMs are handled via Propel rather than the database, they have particular getters and setters in place to correctly map their integer values to the right results. However, when a table uses the versionable behaviour, the versioning functions in the base class completely ignore these, eg:


public function addVersion($con = null)
{
...
$version->setEnumField($this->enum_field);

...

The base version class then rejects this as it's passing through an integer rather than the expected values, giving an error such as:
Value "1" is not accepted in this enumerated column

I presume the fix should be to use the included getter, eg:
$version->setEnumField($this->getEnumField());

StormySan pushed a commit to StormySan/Propel that referenced this issue Aug 15, 2011

willdurand added a commit that referenced this issue Aug 15, 2011

willdurand added a commit that referenced this issue Aug 15, 2011

@willdurand

This comment has been minimized.

Show comment
Hide comment
@willdurand

willdurand Aug 15, 2011

Member

Fixed. See PR #37.

Member

willdurand commented Aug 15, 2011

Fixed. See PR #37.

@willdurand willdurand closed this Aug 15, 2011

willdurand added a commit that referenced this issue Sep 9, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment