Development

#3701 (Warning in error report when generator.yml is invalid)

You must first sign up to be able to contribute.

Ticket #3701 (closed defect: fixed)

Opened 7 months ago

Last modified 7 months ago

Warning in error report when generator.yml is invalid

Reported by: kfowler Assigned to: fabien
Priority: minor Milestone:
Component: generator Version: 1.1.0 RC1
Keywords: Cc:
Qualification: Unreviewed

Description

I ran init-admin (symfony propel:init-admin tut person Person) and then edited the generator.yml:


generator:

class: sfPropelAdminGenerator param:

model_class: Person theme: default

list:

title: Secret


The YML is wrong (list should be under param). Symfony wants to tell me this ("Configuration file "generator.yml" can specify a "list" section but only under the param section.") but line 57 in symfony/config/sfGeneratorConfigHandler.class.php has a minor bug that causes a warning to be displayed:

Notice: Undefined offset: 1 in /usr/share/pear/symfony/config/sfGeneratorConfigHandler.class.php on line 57


Fix: change line 57 from:

throw new sfParseException(sprintf('Configuration file "%s" can specify a "%s" section but only under the param section.', $configFiles[1] ? $configFiles[1] : $configFiles[0], $section));

to:

throw new sfParseException(sprintf('Configuration file "%s" can specify a "%s" section but only under the param section.', array_key_exists(1,$configFiles) ? $configFiles[1] : $configFiles[0], $section));

Change History

06/23/08 05:56:36 changed by dwhittle

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

(In [9770]) 1.0: fixed possible notice in generator config handler (closes #3701)

06/23/08 05:56:59 changed by dwhittle

(In [9771]) 1.1: fixed possible notice in generator config handler (closes #3701)