Development

#3155 ([PATCH] Avoid PHP warning when url_for() has for url a module name)

You must first sign up to be able to contribute.

Ticket #3155 (closed defect: fixed)

Opened 5 months ago

Last modified 5 months ago

[PATCH] Avoid PHP warning when url_for() has for url a module name

Reported by: nicolas Assigned to: fabien
Priority: minor Milestone: 1.1.0
Component: controller Version: 1.1.0 DEV
Keywords: url_for, routing, module Cc:
Qualification: Unreviewed

Description

Maybe it's an intended behavior, but for now calling url_for('mymodule') will display a php warning :

Notice: Undefined offset: 1 in [...]/lib/symfony/controller/sfWebController.class.php on line 145

A (very quick 'n dirty) patch is attached to prevent this.

Attachments

sfWebController.patch (0.6 kB) - added by nicolas on 03/18/08 19:32:36.
Da patchâ„¢

Change History

03/18/08 19:32:36 changed by nicolas

  • attachment sfWebController.patch added.

Da patchâ„¢

03/18/08 23:42:51 changed by fabien

This is the intended behavior in 1.1. You need to pass a module and an action. Perhaps, we can throw an exception if there is no action. What do you think?

03/19/08 08:35:18 changed by nicolas

Yes, why not an InvalidArgumentException, or an UnexpectedValueException ?

03/19/08 12:25:56 changed by fabien

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

(In [7964]) fixed PHP warning when url_for() has for url a module name (closes #3155)

03/19/08 12:26:19 changed by fabien

  • milestone set to 1.1.0.