Development

#3470 (propel:build-forms and Behaviors)

You must first sign up to be able to contribute.

Ticket #3470 (closed defect: fixed)

Opened 1 week ago

Last modified 2 days ago

propel:build-forms and Behaviors

Reported by: Dannyrulez Assigned to: fabien
Priority: major Milestone:
Component: model Version: 1.1.0 BETA4
Keywords: Cc:
Qualification: Unreviewed

Description

Source: http://www.symfony-project.org/forum/index.php/m/51360/

The error I get is this:

>> propel    generating form classes

Warning: constant(): Couldn't find constant MusicArtistPeer::CLASS_DEFAULT in 
C:\AppServ\php5\PEAR\symfony\plugins\sfPropelPlugin\lib\propel\generator\sfPropelFormGenerator.class.php on line 106


  Propel behavior "sfPropelActAsSluggableBehavior" is not registered

I'm using behaviors from the schema.yml

  music_artist: 
    ...
    slug:              { type: varchar(255) }
    _behaviors:
      sfPropelActAsSluggableBehavior:
        columns:       { from: artist_Name, to: slug }

So symfony create this file BaseMusicArtistBehaviors?.php:

<?php
sfPropelBehavior::add('MusicArtist', array (
  'sfPropelActAsSluggableBehavior' => 
  array (
    'columns' => 
    array (
      'from' => 'artist_Name',
      'to' => 'slug',
    ),
  ),
));

If I delete this file, them it create the form class for this model without any problem, but them in the next model with ANY behavior it will throw the same error and stop.

POSIBLE SOLUTION

If whe use the CLI symfony shouldn't call this

include_once 'lib/model/om/BaseMusicArtistBehaviors.php';

from the BaseMusicArtistPeer?.php

Change History

05/09/08 16:35:42 changed by Dannyrulez

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

This represents the same bug as #3502, which fabien just added to the 1.1.0 RC2 milestone.

05/10/08 14:49:07 changed by fabien

  • resolution changed from duplicate to fixed.

(In [8896]) fixed behavior registration bug in propel tasks (closes #3502, #3476, #3470 - patch from Kris.Wallsmith)