Skip to content
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

embedded form with i18n fields #184

Open
ohshhh opened this issue Jan 31, 2013 · 0 comments
Open

embedded form with i18n fields #184

ohshhh opened this issue Jan 31, 2013 · 0 comments

Comments

@ohshhh
Copy link

ohshhh commented Jan 31, 2013

( also you can read question on sof: http://stackoverflow.com/questions/14594900/propel-orm-1-6-symfony-1-4-embeded-i18n-form )
I use propelorm (propel 1.6) plugin and symfony 1.4.20.

I have book table with I18n, and this book have relation with gallery table which also have I18n. I fill all book form fields, added two gallery images, filled all images fields. Click on save - it seems all ok: book fields are ok, first and second image have been uploaded, but only first image have filled i18n fields, second image all i18n fields are empty. What's the prob ?

(there's no redeclared doSave(), save(), bind() and other form methods)

Schema:

book:

id:                   ~
title:                { type: varchar(255), required: true }
author:               { type: varchar(255), required: true }
description:          { type: longvarchar, required: true }
sortable_rank:        { type: integer, required: true }
is_active:            { type: boolean, default: 1 }
_indexes:
  active_sort:        [ is_active, sortable_rank ]
_propel_behaviors:
  sortable:
    rank_column:      sortable_rank
  i18n:
    i18n_columns:     [title, description, author]
    locale_column:    culture
    locale_alias:     culture
    default_locale:   en

book_gallery:

id:                 ~
book_id: { type: integer, foreignTable: book, foreignReference: id, required: true, onDelete: cascade }
title:              { type: varchar(255), required: true }
image:              { type: varchar(255), required: true }
_propel_behaviors:
  i18n:
    i18n_columns:    [title]
    locale_column:   culture
    locale_alias:    culture
    default_locale:  en

book form:

$languages = LanguageQuery::create()->getAllAsArray(); // returns like array('en' => 'english', ...);
$this->embedI18n(array_keys($languages));
$this->widgetSchema->setLabels($languages);
$this->embedRelation('BookGallery', array(
'title' => 'Application book store list',
'item_pattern' => 'Application book store %index%',
));

book gallery form:

$languages = LanguageQuery::create()->getAllAsArray(); // same as in book form
$this->embedI18n(array_keys($languages));
$this->widgetSchema->setLabels($languages);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant