Development

#3730 ([PATCH] typo in sfPropelData?)

You must first sign up to be able to contribute.

Ticket #3730 (closed defect: fixed)

Opened 7 months ago

Last modified 6 months ago

[PATCH] typo in sfPropelData?

Reported by: Kris.Wallsmith Assigned to: FabianLange
Priority: minor Milestone: 1.1.0
Component: other Version: 1.1.0 DEV
Keywords: Cc:
Qualification: Ready for core team

Description

This appears to be a typo, but it's been in the repository for so long ... maybe I'm misunderstanding the intended logic. Anyway, I had to apply this patch to get the new many2many data load to work.

Attachments

sfPropelData-typo-fix.diff (0.8 kB) - added by Kris.Wallsmith on 06/11/08 10:40:15.

Change History

06/11/08 10:40:15 changed by Kris.Wallsmith

  • attachment sfPropelData-typo-fix.diff added.

06/17/08 19:41:17 changed by dwhittle

  • qualification changed from Unreviewed to Design decision.

06/17/08 19:41:29 changed by dwhittle

  • milestone set to 1.1.0 FINAL.

06/26/08 22:20:11 changed by FabianLange

Kris, can you do me a favor and check if it works for you even when removing the primary key from that line at all. I think the main point is that it searches for FKs that relate to a different Table. it shouldnt matter if it is part of a pk or not (in m2m it should at max be part of a composite key). Yoour not("!") prevents it being part of a composite PK, but I guess its much better than the column being a PK, which would not work at all.

06/26/08 22:29:59 changed by FabianLange

  • owner changed from fabien to FabianLange.
  • status changed from new to assigned.
  • qualification changed from Design decision to Ready for core team.

yep, just checked with the functional tests from fabien. His schema is

  <table name="author_article">
    <column name="author_id" type="integer" primaryKey="true" />
    <foreign-key foreignTable="author">
      <reference local="author_id" foreign="id" />
    </foreign-key>
    <column name="article_id" type="integer" primaryKey="true" />
    <foreign-key foreignTable="article">
      <reference local="article_id" foreign="id" />
    </foreign-key>
  </table>

so there is a composite PK that contains both FKs, using your proposad patch fails this test. I assume you have similar schema, but the FKs are not part of the PK, which is most likely a separate column with an autoincrement id. Simply removing the PK check fixes the issue and seems to make sense for me. It shouldnt matter if its PK or not. It just has to be a FK that related to the other table

06/26/08 22:30:29 changed by FabianLange

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [9906]) 1.1: fixed m2m propel data loading. fixes #3730

06/26/08 22:32:36 changed by Kris.Wallsmith

I see. I hadn't considered a mutli-column PK. Thanks for the commit!

06/29/08 23:32:58 changed by FabianLange

  • milestone changed from 1.1.0 FINAL to 1.1.0.