This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

Empty module and/or action after parsing the URL[SOLVED]

Discussion specific to symfony 1.1.x stable

Empty module and/or action after parsing the URL[SOLVED]

by gentrobot » Tue Jan 11, 2011 11:31 am

I am trying to upgrade my project in Symfony 1.0 to Symfony 1.1. I am getting the error "Empty module and/or action after parsing the URL" when tried to make an AJAX reuest on window onload. I am attaching a text file with this post that contains the errors that I have faced so far and their resolutions.
gentrobot
Member
 
Posts: 45
Joined: Thu Oct 08, 2009 7:43 am

Re: Empty module and/or action after parsing the URL

by gentrobot » Tue Jan 11, 2011 11:44 am

I am sorry but couldn't figure out how to post attachments so posting all the progress here:

Removed the config/config.php and created a ProjectConfiguration?.class.php to point to these installation.
Renamed the default symfony.bat to symfony11.bat, to access symfony from the command line.


1. Error: Unable to parse file "C:\xampp\htdocs\myproject_1_3_branch\apps\frontend/config/routing.yml": Unable to parse line 174 (url:/:city/:prop_category.html).
Resolution - added space after ':' routing.yml

2. Error: Declaration of myUser::initialize() should be compatible with that of sfBasicSecurityUser::initialize()
Resolution - modified parameters' list in myUser::initialize() function and made it same as sfBasicSecurityUser::initialize()

3. Error: array_merge() [function.array-merge]: Argument #2 is not an array in \lib\cache\sfCache.class.php
Resolution - modified the cache function call:

Old Code:
$function_cache_dir = sfConfig::get('sf_app_cache_dir').'/function';
$fc = new sfFunctionCache($function_cache_dir);
$fc->setLifeTime(sfConfig::get('app_myprojectsettings_function_time_out'));

New Code:
Code: Select all
$cache = new sfFileCache(array('cache_dir' => sfConfig::get('sf_app_cache_dir').'/function','lifetime' =>
sfConfig::get('app_myprojectsettings_function_time_out')));
$fc = new sfFunctionCache($cache);

ref: http://www.symfony-project.org/book/1_1/18-Performance

4. Error:Function set_magic_quotes_runtime() is deprecated in PHP 5.3.0
Resolution - modified sfFileCache.class.php in Symfony's lib directory as:

Code: Select all
- set_magic_quotes_runtime(0);   
+ if(get_magic_quotes_runtime())
+ {
+    set_magic_quotes_runtime(0);   
+ }

ref: http://stackoverflow.com/questions/2217955/how-can-i-replace-the-deprecated-set-magic-quotes-runtime-in-php/2218021#2218021

5. Error: Escaping strategy "both" is deprecated, please use "on".
Resolution - set escapin strategy to ON in /apps/frontend/config/settings.yml

6. Error: An internal URI must contain a module and an action (module/action) ("/" given)
Resolution - Applied a patch to sfWebController.class.php

Ref - http://oldforum.symfony-project.org/index.php/m/55468/#msg_55468

7. Error: Call to undefined method sfRouting::getContext()
Resolution - Replaced sfRouting::getInstance()->getCurrentRouteName() with sfContext::getInstance()->getRouting()->getCurrentRouteName()

8. Error: Call to undefined method form_tag()
Resolution - form_tag() is no longer valid in Symfony 1.1 need to use plain HTML instead
See - http://trac.symfony-project.org/wiki/Symfony11Helpers

9. Error: Call to undefined method select_tag() Resolution - We need to use the sfWidgetFormSelect class and replace every select_tag. I have done this for the homepage so far.

$
Code: Select all
prop_category = new sfWidgetFormSelect
      (array('choices' =>
             array('title1' =>
                   'Value1',
                   'title2'=>
                   'Value2'
                   )
            ),
       array('onchange' =>
              'loadFunction(\'firstBox\',\'search_str\',\'dropDown\');'
             )
      );
      echo $prop_category->render('prop_category');


See - http://trac.symfony-project.org/wiki/Symfony11Helpers

I had written a custom AssetHelper.php class fro Symfony 1.0. Modified it to be in compliance with Symfony 1.1

Present Error: Again getting the error "Error: Empty module and/or action after parsing the URL "/home/getAreaFromValuation/New%20Delhi" (/)."
However, the routing roule for the URL in question is defined in the routing.yml. Also, these calls are AJAX requests on page load.
gentrobot
Member
 
Posts: 45
Joined: Thu Oct 08, 2009 7:43 am