Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4232570
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T02:06:41+00:00 2026-05-21T02:06:41+00:00

I have this schema: propel: autor: id: ~ nombre: { type: varchar, size: 255,

  • 0

I have this schema:

propel:
  autor:
    id: ~
    nombre: { type: varchar, size: 255, required: true }

  libro:
    id: ~
    autor_id:   { type: integer, size: 11, foreignTable: autor,
foreignReference: id}
    titulo:     { type: varchar, size: 255 }
    paginas:    { type: varchar, size: 255, required: true }

and this form class:

class AutorForm extends BaseAutorForm
{
  public function configure()
  {
    $this->embedRelation('Libro');
  }

public function foo()
{
    $this->validatorSchema['Libro']['newLibro1']['paginas'] = new
sfValidatorPass();
    return $this;

}
}

I’m calling foo() after the bind() (inside processForm()).

After submiting the Auto-Libro form, if I don’t insert anything in the
field ‘paginas’ of the first embedded form (Libro), it shows
“Required”.

But.. why if paginas has a validator-pass?

EDIT: after matt’s answer, this is my code:

var_dump($this->embeddedForms['Libro']->validatorSchema['newLibro1']['paginas']);
$this->embeddedForms['Libro']->validatorSchema['newLibro1']['paginas'] = new sfValidatorPass(array('required' => false));
var_dump($this->embeddedForms['Libro']->validatorSchema['newLibro1']['paginas']);

It prints this:

object(sfValidatorString)[152]
  protected 'requiredOptions' => 
    array
      empty
  protected 'defaultMessages' => 
    array
      'required' => string 'Required.' (length=9)
      'invalid' => string 'Invalid.' (length=8)
      'max_length' => string '"%value%" is too long (%max_length% characters max).' (length=52)
      'min_length' => string '"%value%" is too short (%min_length% characters min).' (length=53)
  protected 'defaultOptions' => 
    array
      'required' => boolean true
      'trim' => boolean false
      'empty_value' => string '' (length=0)
      'max_length' => null
      'min_length' => null
  protected 'messages' => 
    array
      'required' => string 'Required.' (length=9)
      'invalid' => string 'Invalid.' (length=8)
      'max_length' => string '"%value%" is too long (%max_length% characters max).' (length=52)
      'min_length' => string '"%value%" is too short (%min_length% characters min).' (length=53)
  protected 'options' => 
    array
      'required' => boolean true
      'trim' => boolean false
      'empty_value' => string '' (length=0)
      'max_length' => int 255
      'min_length' => null

object(sfValidatorPass)[196]
  protected 'requiredOptions' => 
    array
      empty
  protected 'defaultMessages' => 
    array
      'required' => string 'Required.' (length=9)
      'invalid' => string 'Invalid.' (length=8)
  protected 'defaultOptions' => 
    array
      'required' => boolean true
      'trim' => boolean false
      'empty_value' => null
  protected 'messages' => 
    array
      'required' => string 'Required.' (length=9)
      'invalid' => string 'Invalid.' (length=8)
  protected 'options' => 
    array
      'required' => boolean false  <<<<<<<<<<<< FALSE <<<<<<<<<<<<<<<<<<
      'trim' => boolean false
      'empty_value' => null

The problem is still the same: when i try to submit the form, the field ‘paginas’ is still required. Why?

sf 1.4/propel 1.6

Javi

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T02:06:42+00:00Added an answer on May 21, 2026 at 2:06 am

    Almost all validators, including the sfValidatorPass, default to required=true.

    I believe the sfValidatorPass doesn’t mean “it always passes validation” it means “pass the submitted value through without cleaning it or checking anything.”

    sfValidatorPass is an identity validator. It simply returns the value unmodified.

    So I think you can just do

    $this->validatorSchema['Libro']['newLibro1']['paginas'] = new 
        sfValidatorPass(array('required' => false));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this schema: <xs:complexType name=foo> <xs:sequence> <xs:element name=oneBar type=xs:string minOccurs=0/> <xs:element name=twoBar type=xs:string
I have this schema which I need to match 2 rows from user_data :
Say I have this table schema. ID AccNo Amount Say I have this data
I have this problem decomposing a relation schema into a set of schemas that
I have a table named Info of this schema: int objectId; int time; int
I have a schema like this <h1> 5/2009 <br/> Question: This is the question
So I have a database schema like this: Users UserId RoleUserXRef RoleUserId RoleId UserId
I have an orders table with a schema like this. CREATE TABLE orders (
I have a table in PostgreSQL where the schema looks like this: CREATE TABLE
I have an Oracle account (schema) of a remote Oracle database. By using this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.