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 6943027
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:06:07+00:00 2026-05-27T13:06:07+00:00

Symfony 1.4 Propel (with sfPropel15Plugin) I have a multilanguage Gallery with the following schema:

  • 0

Symfony 1.4
Propel (with sfPropel15Plugin)

I have a multilanguage Gallery with the following schema:

# Galleries

  pi_gallery:
    _attributes:
      phpName: Gallery
      isI18N: true
      i18nTable: pi_gallery_i18n
    _propel_behaviors:
      sortable: ~
    id: ~
    active:
      type: boolean
      default: true
      required: true
    created_at: ~
    updated_at: ~        

  pi_gallery_i18n:
    _attributes:
      phpName: GalleryI18n
    id: 
      type: integer
      foreignTable: pi_gallery
      foreignReference: id
      required: true
      primaryKey: true
      onDelete: cascade
    culture:
      isCulture: true
      type: varchar
      size: 7
      required: true
      primaryKey: true
    name:
      type: varchar
      size: 255
      required: false
    description:
      type: longvarchar
      required: false

# Images

  pi_gallery_image:
    _attributes:
      phpName: GalleryImage
      isI18N: true
      i18nTable: pi_gallery_image_i18n
    id: ~
    gallery_id:
      type: integer
      foreignTable: pi_gallery
      foreignReference: id
      required: true
    image:
      type: varchar
      size: 255
      required: true
    created_at: ~
    updated_at: ~


  pi_gallery_image_i18n:
    _attributes:
      phpName: GalleryImageI18n
    id: 
      type: integer
      foreignTable: pi_gallery_image
      foreignReference: id
      required: true
      primaryKey: true
      onDelete: cascade
    culture:
      isCulture: true
      type: varchar
      size: 7
      required: true
      primaryKey: true
    description:
      type: varchar
      size: 255
      required: false

I’m trying to embed the Image forms in the Gallery using the following:

# GalleryForm.class

    public function configure()
    {
        unset(
            $this['alias'],
            $this['created_at'],
            $this['updated_at']
        );

        $this->widgetSchema['article_id']->setOption('renderer_class', 'sfWidgetFormPropelJQueryAutocompleter');
        $this->widgetSchema['article_id']->setOption('renderer_options', array(
                'model'     => 'Article',
                'url'       => '/article/ajax'
        ));

        $this->validatorSchema['article_id'] = new sfValidatorPass();

        $this->embedI18n(array('es', 'en', 'de', 'it', 'fr'));

        $this->widgetSchema->setLabel('en','English');
        $this->widgetSchema->setLabel('es','Español');
        $this->widgetSchema->setLabel('de','Deutsch');
        $this->widgetSchema->setLabel('it','Italiano');
        $this->widgetSchema->setLabel('fr','Francais');

        $this->embedRelation('GalleryImage'); // Embeds the Relation between the GalleryImage model and the Gallery Model
    }


# GalleryImageForm.class:    

    public function configure()
    {        
        unset(
            $this['created_at'],
            $this['updated_at'],
            $this['gallery_id'],
            $this['sortable_rank']
        );

        if ($this->isNew()) unset($this['id']);

        $this->embedI18n(array('es', 'en', 'de', 'it', 'fr'));            

        $image = $this->getObject()->getImage();

        $template = (!is_null($image) || $image != "") ? '<div>%file%<br />%input%<br />%delete% %delete_label%</div>' : '';            

        $this->widgetSchema['image'] = new sfWidgetFormInputFileEditable(array(
            'label' => 'Imagen',
            'file_src' => '/'.sfConfig::get('sf_upload_dir_name').'/images/galleries/thumbs/'.substr($this->getObject()->getImage(),0,-4) . '.jpg',
            'is_image' => true,
            'edit_mode' => !$this->isNew() && $image != "",
            'with_delete' => true,
            'delete_label'=>'Eliminar archivo existente',
            'template' => $template
        ));


        $this->validatorSchema['image_delete'] = new sfValidatorPass();          

        $this->validatorSchema['image'] = new sfValidatorFile(array(
            'path' => sfConfig::get('sf_upload_dir').'/images/galleries',
            'required' => false,
            'mime_types' => 'web_images'
        ));
    }

This appears to embed the forms as expected … initially. The GalleryForm appears with Multilanguage Descriptions and the ImageForms embed beneath them. So far so good.

Saving the form however shows that all is not good.

Two records are saved initially, one with just the image and the other with just the i18n fields. The i18n fields also have the id of the second record added so there is no way of relating the image to the i18n fields. Maybe the order of saving the forms is wrong?

Has anyone successfully got a form to work that embeds I18n in an embedded Relation? Or does anyone have any idea of a workaround? I’ve read about something about overriding saveEmbeddedForms but I don’t even know where to start with that.

Any help appreciated.

  • 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-27T13:06:08+00:00Added an answer on May 27, 2026 at 1:06 pm

    Fixed in the sfPropelORMPlugin:

    • https://github.com/propelorm/sfPropelORMPlugin/issues/13
    • https://github.com/propelorm/sfPropelORMPlugin/pull/76
    • https://github.com/propelorm/sfPropelORMPlugin/issues/38
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

quick symfony / propel question. I have the following propel collection route: api_offer: class:
I change schema.yml from time to time and execute: symfony propel:build-all-load but the lib/_model
we using symfony 1.0. We have an module work with Propel objects. The sql-querys
In Symfony 2 I have the following code in my Controller: // prepare to
Straight to the point -- I have a Symfony 1.3 / Propel 1.4 project.
I am using Symfony 1.2.9 (with Propel ORM), to build a website. I have
I am using Symfony 1.4 and Propel as ORM. I have created a form
I am working with Symfony 1.4 and propel, I have a form for products
I am using Symfony 1.4.8 and Propel as ORM. I have created a custom
I have created a collection form in symfony 1.4 and Propel 1.5 and everything

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.