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

  • Home
  • SEARCH
  • 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 1106681
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:49:46+00:00 2026-05-17T01:49:46+00:00

InvalidArgumentException widget attention does not exist When I remove attention, captcha gives the same

  • 0

InvalidArgumentException widget “attention” does not exist

When I remove “attention”, “captcha” gives the same error. Neither one of these fields are in the database. I had this working earlier until I tried to pass a variable to the form from actions. I took that out but I’m still getting an error

Any thoughts on what I’m doing wrong? Thanks:

Base form:

abstract class BaseItemsForm extends BaseFormDoctrine
{
  public function setup()
  {

    $this->widgetSchema->setNameFormat('items[%s]');

    $this->setWidgets(array(
      'city_id'         => new sfWidgetFormInputText(),
      'state_id'        => new sfWidgetFormInputText(),
      'item_id'         => new sfWidgetFormInputHidden(),
      'name'            => new sfWidgetFormInputText(),
      'address'         => new sfWidgetFormInputText(),
      'city'            => new sfWidgetFormInputText(),
      'state'           => new sfWidgetFormInputText(),
      'zip'             => new sfWidgetFormInputText(),
      'zip9'            => new sfWidgetFormInputText(),
      'county'          => new sfWidgetFormInputText(),
      'url'             => new sfWidgetFormInputText(),
      'phone'           => new sfWidgetFormInputText(),
      'fax'             => new sfWidgetFormInputText(),
      'owner'           => new sfWidgetFormInputText(),
      'title'           => new sfWidgetFormInputText(),
      'gender'          => new sfWidgetFormInputText(),
      'employee'        => new sfWidgetFormInputText(),
      'sales'           => new sfWidgetFormInputText(),
      'category_id'     => new sfWidgetFormInputText(),
      'attention'       => new sfWidgetFormChoice(array(
  'choices'  => Doctrine_Core::getTable('Items')->getAttn(),
  'multiple' => false, 'expanded' => false)),
      'captcha'         => new sfWidgetFormReCaptcha(array(
  'public_key' => '******'
)),
      'sic_description' => new sfWidgetFormInputText(),
      'custom'          => new sfWidgetFormInputText(),
      'added'           => new sfWidgetFormDateTime(),
      'user_id'         => new sfWidgetFormInputText(),
      'logo'            => new sfWidgetFormInputText(),
      'approved'        => new sfWidgetFormInputText()
    ));




    $this->setValidators(array(
      'city_id'         => new sfValidatorInteger(),
      'state_id'        => new sfValidatorInteger(),
      'item_id'         => new sfValidatorChoice(array('choices' => array($this->getObject()->get('item_id')), 'empty_value' => $this->getObject()->get('item_id'), 'required' => false)),
      'name'            => new sfValidatorString(array('max_length' => 255)),
      'address'         => new sfValidatorString(array('max_length' => 255)),
      'city'            => new sfValidatorString(array('max_length' => 64)),
      'state'           => new sfValidatorString(array('max_length' => 2)),
      'zip'             => new sfValidatorString(array('max_length' => 5)),
      'zip9'            => new sfValidatorString(array('max_length' => 10)),
      'county'          => new sfValidatorString(array('max_length' => 64)),
      'url'             => new sfValidatorString(array('max_length' => 255, 'required'   => false)),
      'phone'           => new sfValidatorString(array('max_length' => 32)),
      'fax'             => new sfValidatorString(array('max_length' => 32,  'required'   => false)),
      'owner'           => new sfValidatorString(array('max_length' => 128)),
      'title'           => new sfValidatorString(array('max_length' => 128)),
      'gender'          => new sfValidatorString(array('max_length' => 6)),
      'employee'        => new sfValidatorString(array('max_length' => 6)),
      'sales'           => new sfValidatorString(array('max_length' => 16)),
      'category_id'     => new sfValidatorString(array('max_length' => 10)),
      'attention'     => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'captcha'         => new sfValidatorReCaptcha(array(
  'private_key' => '******'
)),
      'sic_description' => new sfValidatorString(array('max_length' => 128)),
      'custom'          => new sfValidatorInteger(),
      'added'           => new sfValidatorString(array('max_length' => 255)),
      'user_id'         => new sfValidatorInteger(),
      'logo'            => new sfValidatorString(array('max_length' => 50, 'required'   => false)),
      'approved'        => new sfValidatorInteger(array('required' => false)),
    ));



    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Items';
  }

}

Form

    class ItemsUserForm extends BaseItemsForm
{
  public function setUserId($id)
  {
    $this->getObject()->setUser_id($id);
  }
  public function configure()
  {
      unset(
      $this['zip9'], 
      $this['city_id'], $this['state_id'],
      $this['county'], $this['url'],
      $this['title'], $this['gender'],
      $this['employee'], $this['sales'],
      $this['custom'],
      $this['added'], $this['user_id'],
      $this['logo']
    );

    $this->widgetSchema->setLabels(array(
      'owner'    => 'Your Name:*',
      'phone'    => 'Your Phone:*',
      'fax'    => 'Your Fax:*',
      'name'    => 'Business Name:*',
      'address'    => 'Business Address:*',
      'city'    => 'City:*',
      'state'    => 'State:*',
      'zip'    => 'Zipcode:*',
      'category_id'    => 'Category/Keyword:*',
      'attention'       => 'Attention:*',
      'sic_description'    => 'Business Description Message:*',
      'captcha'    => 'Image Verification:*'
    ));
  }

}

Action

  public function executeNew(sfWebRequest $request)
  {
    $this->form = new itemsUserForm();
  }
  • 1 1 Answer
  • 1 View
  • 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-17T01:49:46+00:00Added an answer on May 17, 2026 at 1:49 am

    I found the problem.

    I forget to change the form in executeCreate. I changed the line to reflect executeNew and now its working.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am running Symfony 2.0.6, and I get the following error: InvalidArgumentException: There is
i get an InvalidArgumentException while casting Control to System.Windows.Forms.Textbox: Unable to cast object of
I tried to throw an InvalidArgumentException in a Silverlight 3 class library, and this
When would you use InvalidArgumentException versus OutOfRangeException for parameters to a method? Would you
My app is still in development so I am not trying to do anything
When I try to take some nonexistent content from page I catch this error:
Do I need to create my own InvalidArgumentException.. I couldn't find any built-in types
public static function GetDirectLoginUser($username, $password) { if (!is_string($username)) { throw new InvalidArgumentException('Usernames must be
I have not yet been able to find a list of all the built-in
I've added a button the my navigation bar like so: UIBarButtonItem *anotherButton = [[UIBarButtonItem

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.