Development

#3026 (sfLoader::getConfigPaths() uses wrong module directory)

You must first sign up to be able to contribute.

Ticket #3026 (closed defect: wontfix)

Opened 9 months ago

Last modified 5 months ago

sfLoader::getConfigPaths() uses wrong module directory

Reported by: manuel Assigned to: fabien
Priority: major Milestone:
Component: validation Version: 1.0.11
Keywords: Cc:
Qualification: Design decision

Description

Hey there,

in sfLoader.class.php, line 261, the directory to call module class from is set to

sfConfig::get('sf_app_dir').'/'.$configPath

For a validation (let's say of action someAction in module someModule) this code will find the validation file 'validate/someAction.yml', i.e. $configPath will be equal to 'modules/someModule/validate/someAction.yml'.

This is a bit ugly, since there exists a special variable for the model directory called sfConfig::get('sf_app_module_dir'). However it works as long as the module directory is not changed.

Problem: If the module directory path is changed (=sfConfig::set('sf_app_module_dir', 'another/directory/on/disk')) without modifying the apps directory path, Symfony doesn't find the module's validation files (someAction.yml) anymore.

Hence: the $configPath should get rid of its 'modules' prefix, and line 261 should be substituted by

sfConfig::get('sf_app_module_dir').'/'.$configPath

Or am I wrong?

Cheers Manu

Change History

(follow-up: ↓ 2 ) 02/28/08 14:19:26 changed by manuel

In case someone needs a workaround until this is fixed: Add into line 262 of sfLoader.class.php:

sfConfig::get('sf_app_module_dir').'/'.$configPath.'/'.str_replace('modules/','',$configPath);

(in reply to: ↑ 1 ) 02/28/08 14:20:28 changed by manuel

Sorry, I meant:

$files[] = sfConfig::get('sf_app_module_dir').'/'.$configPath.'/'.str_replace('modules/','',$configPath);

Replying to manuel:

In case someone needs a workaround until this is fixed: Add into line 262 of sfLoader.class.php: {{{ sfConfig::get('sf_app_module_dir').'/'.$configPath.'/'.str_replace('modules/',,$configPath); }}}

04/01/08 10:30:49 changed by nicolas

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

(In [8176]) Fixes #3026 - Simple quotes are no more escaped by Tag helper escaping function

04/01/08 14:59:42 changed by nicolas

  • status changed from closed to reopened.
  • resolution deleted.

Sorry r8176 fixes #3206, not #3026 (doh!), so I reopen this one.

06/23/08 07:01:40 changed by dwhittle

  • qualification changed from Unreviewed to Design decision.
  • milestone set to 1.0.17.

06/24/08 11:10:53 changed by fabien

  • status changed from reopened to closed.
  • resolution set to wontfix.
  • milestone deleted.

This is a known limitation of symfony 1.0. This has been fixed in 1.1.