Form Generation : M2M false recognition #88

jaugustin opened this Issue Oct 13, 2011 · 4 comments

4 participants

Propel member


Today the Form generator automaticaly detect Many to Many relation:

A table is considered to be a m2m table if it has 2 foreign keys that are also primary keys.

It generate multiple list in the form for table related to a M2M.

Or if the M2M contain extra fields (another PK field or other fields) it should'nt generate the multiple liste because it will never work and break the table.

I think it should test that the table has only 2 fields.

I could try to provide a PR

Propel member

The logic from sfPropelGenerator should be rewritten to use real man,y-to-many relationships, ie declared using a crossRef table in the schema.

Propel member
Propel member
Propel member

I talk with @fzaninotto and he find a better way to do the getManyToManyTables. The isCrossRef attribute is not needed anymore.

I will write a new PR.

What will do the "new" getManyToManyTables:

Get Many To Many relations of the current table
Find the common table (crossRef)
Build the table array.

@jaugustin jaugustin added a commit to jaugustin/sfPropelORMPlugin that referenced this issue Mar 11, 2012
@jaugustin jaugustin Propel Generator: for getManyToManyTables use real ManyToMany, fixes #88
@komapa komapa added a commit to CollectorsQuest/sfPropelORMPlugin that referenced this issue Mar 28, 2012
@komapa komapa Merge remote-tracking branch 'upstream/master'
* upstream/master:
  Update propel to 1.6.5
  Fix CS
  Make the xmlhttp in POST to enable explain on big queries
  Enable to show the explanation for a query in the symfony debug bar
  fix wrong version of sfPropelORMPlugin, fix last non cross platform directory separator
  fix tests and add new tests for many to many handle with isCrossref parameter
  made test installer cross platform
  Propel Generator: for getManyToManyTables use real ManyToMany, fixes #88
  Fixed tests thanks to travis-ci
  [Tests] Fixed submodules issue
  Fix: backported the PR #110 from the PropelBundle, which fixes the handling of array type in data loader
  Revert "keep locale default value in the i18n objects
  Fixed CS
  Test for Enum Values with spaces
  Fix to avoid problems on enumerated values that contains with spaces inner the value
  Fixed installer for the test suite, now you can run the '' script, and test your code.
  keep locale default value in the i18n objects see mazenovi/sfPropelORMPlugin@b353abc
  update propel lib to last master rev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment