Skip to content

Error when submitting empty value for optional choice field in Propel #16478

@mcrawford-dayspring

Description

@mcrawford-dayspring

Issue #14583 was fixed for Doctrine, but is still broken for Propel and the Propel Bridge (PostgreSQL for the database). Submitting an empty value for a choice list gives the error:

Invalid text representation: 7 ERROR: invalid input syntax for integer: ""

The code from the original post in #14583 (adjusted for PHP 5.3) seems to fix the problem:

public function getChoicesForValues(array $values)
    {
        if (empty($values)) {
            return array();
        } else {
            $first = reset($values);
            if (empty($first)) {
                return array();
            }
        }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions