Development

#1587 (sfDoctrine Admin helpers)

You must first sign up to be able to contribute.

Ticket #1587 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

sfDoctrine Admin helpers

Reported by: Erik.Dahne Assigned to: chtito
Priority: minor Milestone:
Component: sfDoctrinePlugin Version: 1.0.0
Keywords: sfDoctrine admin helper many-2-many Cc:
Qualification:

Description

the doctrine_admin_check_list works fine for many-2-many relations, the doctrine_admin_double_list doesn't. Existing associations are deleted when using the double list, new ones are not written to the database.

my schema.yml:

sfGuardGroup:
  tableName: sf_guard_group
  columns:
    name:
      columnName:
      type: string
      size: 255
    description:
      columnName:
      type: string
      size: 4000
sfGuardGroupPermission:
  tableName: sf_guard_group_permission
  columns:
    group_id:
      columnName:
      type: integer
      size: 11
      foreignClass: sfGuardGroup
      foreignReference: id
      localName: group_permissions
      counterpart: permission_id
      cascadeDelete: 1
    permission_id:
      columnName:
      type: integer
      size: 11
      foreignClass: sfGuardPermission
      foreignReference: id
      localName: permission_groups
      counterpart: group_id
      cascadeDelete: 1
sfGuardPermission:
  tableName: sf_guard_permission
  columns:
    name:
      columnName:
      type: string
      size: 255
    description:
      columnName:
      type: string
      size: 4000

my generator.yml:

generator:
  class:              sfDoctrineAdminGenerator
  param:
    model_class:      sfGuardGroup
    theme:            default

    list:
      title: Group list

    edit:
      title:        Edit "%%name%%" group
      fields:
        group_permissions: { type: doctrine_admin_double_list, name: permissions }
      display:        [ name, description, group_permissions ]

Change History

04/14/07 09:07:27 changed by chtito

I have no precise idea of what is causing this problem... My guess is that the problem comes from an assumption in ObjectAdminHelper that the collections retrieved from the db is an array (that's what you get with propel) whereas doctrine returns a Collection object. Knowing that check_list works properly, a careful examination of the two function should give the answer.

Any help for that would be greatly appreciated.

04/30/07 07:51:55 changed by chtito

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

(In [3883]) patch by kunstantin to fix a long standing doctrine_admin_double_list bug; fixes #1587