This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » legacy support » symfony 1.1 » An internal URI must contain a module and an action
An internal URI must contain a module and an action [message #55418] Thu, 03 July 2008 13:42 Go to next message
mdlugi  is currently offline mdlugi
Messages: 8
Registered: July 2008
Junior Member
After Installing Symfony 1.1 i'd got some problems with forms.

I fixed this case with the new form framework.

now i've got something like:

/backend/modules/item/listSuccess.php
<form action="<?php echo url_for('item/list') ?>" method="POST">
<?= $form['search']?>
</form>

(Doesn't need a submit button because it's an AJAX app inside which refreshes everytime, something is typed in the input field)

But now im getting a dubious error:
An internal URI must contain a module and an action (module/action) ("item" given).

anyone got an idea how to fix this`?

[Updated on: Thu, 03 July 2008 13:48]

Re: An internal URI must contain a module and an action -> full stack trace [message #55419 is a reply to message #55418 ] Thu, 03 July 2008 14:03 Go to previous messageGo to next message
mdlugi  is currently offline mdlugi
Messages: 8
Registered: July 2008
Junior Member
[InvalidArgumentException]
An internal URI must contain a module and an action (module/action) ("item" given).
stack trace

* at ()
in SF_SYMFONY_LIB_DIR/controller/sfWebController.class.php line 149 ...
146. }
147. else
148. {
149. throw new InvalidArgumentException(sprintf('An internal URI must contain a module and an action (module/action) ("%s" given).', $givenUrl));
150. }
151.
152. // split the query string
* at sfWebController->convertUrlStringToParameters('item')
in SF_SYMFONY_LIB_DIR/controller/sfWebController.class.php line 64 ...
61. $parameters = substr($parameters, 0, $pos);
62. }
63.
64. list($route_name, $parameters) = $this->convertUrlStringToParameters($parameters);
65. }
66.
67. if (sfConfig::get('sf_url_format') == 'PATH')
* at sfWebController->genUrl('item', '')
in SF_SYMFONY_LIB_DIR/helper/UrlHelper.php line 41 ...
38. */
39. function url_for($internal_uri, $absolute = false)
40. {
41. return sfContext::getInstance()->getController()->genUrl($internal_uri, $absolute);
42. }
43.
44. /**
* at url_for('item', '')
in SF_SYMFONY_LIB_DIR/helper/UrlHelper.php line 100 ...
97. unset($html_options['absolute']);
98. }
99.
100. $html_options['href'] = url_for($internal_uri, $absolute);
101.
102. if (isset($html_options['query_string']))
103. {
* at link_to('Einträge', 'item')
in SF_ROOT_DIR/apps/backend/modules/user/templates/_menu.php line 4 ...
1. <div class="infobox2">
2. <h4>Menü</h4>
3. <div class="menubox">
4. <h5><?= image_tag('icons/application.png')?>&nbsp;<?= link_to('Einträge','item')?></h5>
5. <?php if($sf_params->get('module')=='item'):?>
6. &nbsp;&nbsp;&nbsp;&nbsp;<?= link_to('&#x95; Liste','item/list')?><br>
7. &nbsp;&nbsp;&nbsp;&nbsp;<?= link_to('&#x95; Erstellen','item/create')?>
* at require('/var/www/dlugi.symfony.cmo.de/httpdocs/branchenbuch /apps/backend/modules/user/templates/_menu.php')
in SF_SYMFONY_LIB_DIR/view/sfPHPView.class.php line 77 ...
74. // render
75. ob_start();
76. ob_implicit_flush(0);
77. require($_sfFile);
78.
79. return ob_get_clean();
80. }
* at sfPHPView-> renderFile('/var/www/dlugi.symfony.cmo.de/httpdocs/branchenb uch/apps/backend/modules/user/templates/_menu.php')
in SF_SYMFONY_LIB_DIR/view/sfPartialView.class.php line 93 ...
90. $this->getAttributeHolder()->set('sf_type', 'partial');
91.
92. // render template
93. $retval = $this->renderFile($this->getDirectory().'/'.$this->getTemplate());
94.
95. if (sfConfig::get('sf_cache'))
96. {
* at sfPartialView->render()
in SF_SYMFONY_LIB_DIR/helper/PartialHelper.php line 148 ...
145. $view->setPartialVars($vars);
146. $view->getAttributeHolder()->add($allVars);
147.
148. return $view->render();
149. }
150. }
151.
* at get_component('user', 'menu', array())
in SF_SYMFONY_LIB_DIR/helper/PartialHelper.php line 115 ...
112. */
113. function include_component($moduleName, $componentName, $vars = array())
114. {
115. echo get_component($moduleName, $componentName, $vars);
116. }
117.
118. /**
* at include_component('user', 'menu')
in SF_ROOT_DIR/apps/backend/templates/layout.php line 91 ...
88. <td colspan="2" class="headerbg">&nbsp;</td>
89. </tr>
90. <tr valign="top">
91. <td><?php include_component('user','menu')?></td>
92. <td width="100%"><?php echo $sf_content ?></td>
93. </tr>
94. <tr>
* at require('/var/www/dlugi.symfony.cmo.de/httpdocs/branchenbuch /apps/backend/templates/layout.php')
in SF_SYMFONY_LIB_DIR/view/sfPHPView.class.php line 77 ...
74. // render
75. ob_start();
76. ob_implicit_flush(0);
77. require($_sfFile);
78.
79. return ob_get_clean();
80. }
* at sfPHPView-> renderFile('/var/www/dlugi.symfony.cmo.de/httpdocs/branchenb uch/apps/backend/templates/layout.php')
in SF_SYMFONY_LIB_DIR/view/sfPHPView.class.php line 135 ...
132. $this->attributeHolder->set('sf_type', 'layout');
133.
134. // render the decorator template and return the result
135. $ret = $this->renderFile($this->getDecoratorDirectory().'/'.$this- >getDecoratorTemplate());
136.
137. $this->attributeHolder = $attributeHolder;
138.
* at sfPHPView->decorate('
Einträge - Liste

Suche
Volltext-Suche
Liste
Inhalt wird geladen
')
in SF_SYMFONY_LIB_DIR/view/sfPHPView.class.php line 185 ...
182. // now render decorator template, if one exists
183. if ($this->isDecorator())
184. {
185. $content = $this->decorate($content);
186. }
187.
188. return $content;
* at sfPHPView->render()
in SF_SYMFONY_LIB_DIR/plugins/sfCompat10Plugin/lib/filter/sfVal idationExecutionFilter.class.php line 255 ...
252. break;
253.
254. case sfView::RENDER_CLIENT:
255. $viewData = $view->render();
256. $this->context->getResponse()->setContent($viewData);
257. break;
258.
* at sfValidationExecutionFilter->executeView('item', 'list', 'Success', array(null, object('ItemForm')))
in SF_SYMFONY_LIB_DIR/plugins/sfCompat10Plugin/lib/filter/sfVal idationExecutionFilter.class.php line 216 ...
213. return;
214. }
215.
216. $this->executeView($actionInstance->getModuleName(), $actionInstance->getActionName(), $viewName, $actionInstance->getVarHolder()->getAll());
217. }
218.
219. /**
* at sfValidationExecutionFilter->handleView(object('sfFilterChain'), object('itemActions'), 'Success')
in SF_SYMFONY_LIB_DIR/plugins/sfCompat10Plugin/lib/filter/sfVal idationExecutionFilter.class.php line 56 ...
53. $timer = sfTimerManager::getTimer(sprintf('View "%s" for "%s/%s"', $viewName, $actionInstance->getModuleName(), $actionInstance->getActionName()));
54. }
55.
56. $this->handleView($filterChain, $actionInstance, $viewName);
57.
58. if (sfConfig::get('sf_debug') && sfConfig::get('sf_logging_enabled'))
59. {
* at sfValidationExecutionFilter->execute(object('sfFilterChain'))
in SF_SYMFONY_LIB_DIR/filter/sfFilterChain.class.php line 53 ...
50. }
51.
52. // execute the next filter
53. $this->chain[$this->index]->execute($this);
54. }
55. }
56.
* at sfFilterChain->execute()
in SF_SYMFONY_LIB_DIR/filter/sfCommonFilter.class.php line 29 ...
26. public function execute($filterChain)
27. {
28. // execute next filter
29. $filterChain->execute();
30.
31. // execute this filter only once
32. $response = $this->context->getResponse();
* at sfCommonFilter->execute(object('sfFilterChain'))
in SF_SYMFONY_LIB_DIR/filter/sfFilterChain.class.php line 53 ...
50. }
51.
52. // execute the next filter
53. $this->chain[$this->index]->execute($this);
54. }
55. }
56.
* at sfFilterChain->execute()
in SF_SYMFONY_LIB_DIR/filter/sfRenderingFilter.class.php line 33 ...
30. public function execute($filterChain)
31. {
32. // execute next filter
33. $filterChain->execute();
34.
35. if (sfConfig::get('sf_logging_enabled'))
36. {
* at sfRenderingFilter->execute(object('sfFilterChain'))
in SF_SYMFONY_LIB_DIR/filter/sfFilterChain.class.php line 53 ...
50. }
51.
52. // execute the next filter
53. $this->chain[$this->index]->execute($this);
54. }
55. }
56.
* at sfFilterChain->execute()
in SF_SYMFONY_LIB_DIR/controller/sfController.class.php line 250 ...
247. }
248.
249. // process the filter chain
250. $filterChain->execute();
251. }
252. else
253. {
* at sfController->forward('item', 'list')
in SF_SYMFONY_LIB_DIR/controller/sfFrontWebController.class.php line 53 ...
50. }
51.
52. // make the first request
53. $this->forward($moduleName, $actionName);
54. }
55. catch (sfException $e)
56. {
* at sfFrontWebController->dispatch()
in SF_SYMFONY_LIB_DIR/util/sfContext.class.php line 164 ...
161. */
162. public function dispatch()
163. {
164. $this->getController()->dispatch();
165. }
166.
167. /**
* at sfContext->dispatch()
in SF_ROOT_DIR/web/backend_dev.php line 6 ...
3. require_once(dirname(__FILE__).'/../config/ProjectConfigurat ion.class.php');
4.
5. $configuration = ProjectConfiguration::getApplicationConfiguration('backend', 'dev', true);
6. sfContext::createInstance($configuration)->dispatch();
7.

symfony settings ...

mod_item_enabled: true
mod_item_is_internal: false
mod_item_view_class: sfPHP
mod_user_enabled: true
mod_user_is_internal: false
mod_user_view_class: sfPHP
sf_admin_web_dir: /sf/sf_admin
sf_app: backend
sf_app_base_cache_dir: /var/www/dlugi.symfony.cmo.de/httpdocs/branchenbuch/cache/ba ckend
sf_app_cache_dir: /var/www/dlugi.symfony.cmo.de/httpdocs/branchenbuch/cache/ba ckend/dev
sf_app_config_dir: /var/www/dlugi.symfony.cmo.de/httpdocs/branchenbuch/apps/bac kend/config
sf_app_dir: /var/www/dlugi.symfony.cmo.de/httpdocs/branchenbuch/apps/bac kend
sf_app_i18n_dir: /var/www/dlugi.symfony.cmo.de/httpdocs/branchenbuch/apps/bac kend/i18n
sf_app_lib_dir: /var/www/dlugi.symfony.cmo.de/httpdocs/branchenbuch/apps/bac kend/lib
sf_app_module_dir: /var/www/dlugi.symfony.cmo.de/httpdocs/branchenbuch/apps/bac kend/modules
sf_app_template_dir: /var/www/dlugi.symfony.cmo.de/httpdocs/branchenbuch/apps/bac kend/templates
sf_apps_dir: /var/www/dlugi.symfony.cmo.de/httpdocs/branchenbuch/apps
sf_cache: false
sf_cache_dir: /var/www/dlugi.symfony.cmo.de/httpdocs/branchenbuch/cache
sf_calendar_web_dir: /sf/calendar
sf_charset: utf-8
sf_check_lock: false
sf_check_symfony_version: false
sf_compat_10: true
sf_compressed: false
sf_config_cache_dir: /var/www/dlugi.symfony.cmo.de/httpdocs/branchenbuch/cache/ba ckend/dev/config
sf_config_dir: /var/www/dlugi.symfony.cmo.de/httpdocs/branchenbuch/config
sf_csrf_secret: false
sf_data_dir: /var/www/dlugi.symfony.cmo.de/httpdocs/branchenbuch/data
sf_debug: true
sf_default_culture: en
sf_doc_dir: /var/www/dlugi.symfony.cmo.de/httpdocs/branchenbuch/doc
sf_enabled_modules:
- default
sf_environment: dev
sf_error_404_action: error404
sf_error_404_module: default
sf_error_reporting: 4095
sf_escaping_method: ESC_SPECIALCHARS
sf_escaping_strategy: false
sf_etag: true
sf_execution_filter:
- sfValidationExecutionFilter
- { }
sf_i18n: false
sf_i18n_cache_dir: /var/www/dlugi.symfony.cmo.de/httpdocs/branchenbuch/cache/ba ckend/dev/i18n
sf_lib_dir: /var/www/dlugi.symfony.cmo.de/httpdocs/branchenbuch/lib
sf_log_dir: /var/www/dlugi.symfony.cmo.de/httpdocs/branchenbuch/log
sf_logging_enabled: true
sf_login_action: login
sf_login_module: default
sf_max_forwards: 5
sf_module_cache_dir: /var/www/dlugi.symfony.cmo.de/httpdocs/branchenbuch/cache/ba ckend/dev/modules
sf_module_disabled_action: disabled
sf_module_disabled_module: default
sf_no_script_name: false
sf_orm: propel
sf_path_info_array: SERVER
sf_path_info_key: PATH_INFO
sf_plugins_dir: /var/www/dlugi.symfony.cmo.de/httpdocs/branchenbuch/plugins
sf_prototype_web_dir: /sf/prototype
sf_relative_url_root: null
sf_rich_text_js_dir: js/tiny_mce
sf_root_dir: /var/www/dlugi.symfony.cmo.de/httpdocs/branchenbuch
sf_secure_action: secure
sf_secure_module: default
sf_standard_helpers:
- Partial
- Cache
- Form
sf_strip_comments: true
sf_symfony_lib_dir: /usr/share/pear/symfony
sf_template_cache_dir: /var/www/dlugi.symfony.cmo.de/httpdocs/branchenbuch/cache/ba ckend/dev/template
sf_test_cache_dir: /var/www/dlugi.symfony.cmo.de/httpdocs/branchenbuch/cache/ba ckend/dev/test
sf_test_dir: /var/www/dlugi.symfony.cmo.de/httpdocs/branchenbuch/test
sf_timer_start: 1215086409.113
sf_upload_dir: /var/www/dlugi.symfony.cmo.de/httpdocs/branchenbuch/web/uplo ads
sf_url_format: PATH
sf_use_database: true
sf_validation_error_class: form_error
sf_validation_error_id_prefix: error_for_
sf_validation_error_prefix: '·'
sf_validation_error_suffix: '·'
sf_web_debug: true
sf_web_debug_web_dir: /sf/sf_web_debug
sf_web_dir: /var/www/dlugi.symfony.cmo.de/httpdocs/branchenbuch/web
sf_yui_js_dir: /sfYUIPlugin/js/yui
sf_yui_js_suffix: -min
sf_yuiext_js_dir: /sfYUIPlugin/js/yui-ext

request ...

parameterHolder:
action: list
module: item
attributeHolder:
formats: { txt: text/plain, js: [application/javascript, application/x-javascript, text/javascript], css: text/css, json: [application/json, application/x-json], xml: [text/xml, application/xml, application/x-xml], rdf: application/rdf+xml, atom: application/atom+xml }

response ...

options:
logging: '1'
charset: utf-8
content_type: 'text/html; charset=utf-8'
cookies: { }
httpHeaders:
Content-Type: 'text/html; charset=utf-8'
javascripts:
first: { }
'': { /sf/prototype/js/prototype: { } }
last: { }
stylesheets:
first: { }
'': { backend: { } }
last: { }
metas:
title: Branchenbuch
robots: 'index, follow'
description: 'symfony project'
keywords: 'symfony, project'
language: en
httpMetas:
Content-Type: 'text/html; charset=utf-8'

user ...

options:
auto_shutdown: false
culture: null
default_culture: en
use_flash: true
logging: '1'
timeout: 1800
attributeHolder:
symfony/user/sfUser/attributes: { filter_active: 0, item_id: null, search: null, search_inside: true }
culture: en

global vars ...

cookie:
cmo_bb: q2io6b4r978dfg4opdvbgrc6g1
env:
CONSOLE: /dev/console
HOME: /
INIT_VERSION: sysvinit-2.86
LANG: C
PATH: '/sbin:/usr/sbin:/bin:/usr/bin'
PREVLEVEL: 'N'
PWD: /
RUNLEVEL: '3'
SELINUX_INIT: 'YES'
SHLVL: '3'
TERM: linux
_: /usr/sbin/httpd
previous: 'N'
runlevel: '3'
files: { }
get: { }
post: { }
server:
DOCUMENT_ROOT: /var/www/dlugi.symfony.cmo.de/httpdocs
GATEWAY_INTERFACE: CGI/1.1
HTTP_ACCEPT: 'text/xml,application/xml,application/xhtml+xml,text/html;q= 0.9,text/plain;q=0.8,image/png,*/*;q=0.5'
HTTP_ACCEPT_CHARSET: 'ISO-8859-1,utf-8;q=0.7,*;q=0.7'
HTTP_ACCEPT_ENCODING: 'gzip,deflate'
HTTP_ACCEPT_LANGUAGE: de-DE
HTTP_CACHE_CONTROL: max-age=0
HTTP_CONNECTION: keep-alive
HTTP_COOKIE: cmo_bb=q2io6b4r978dfg4opdvbgrc6g1
HTTP_HOST: dlugi.symfony.cmo.de
HTTP_KEEP_ALIVE: '300'
HTTP_USER_AGENT: 'Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.15) Gecko/20080623 Firefox/2.0.0.15'
PATH: '/sbin:/usr/sbin:/bin:/usr/bin'
PATH_INFO: /item/list
PATH_TRANSLATED: /var/www/dlugi.symfony.cmo.de/httpdocs/item/list
PHP_SELF: /branchenbuch/web/backend_dev.php/item/list
QUERY_STRING: ''
REMOTE_ADDR: 81.90.32.78
REMOTE_PORT: '3923'
REQUEST_METHOD: GET
REQUEST_TIME: 1215086409
REQUEST_URI: /branchenbuch/web/backend_dev.php/item/list
SCRIPT_FILENAME: /var/www/dlugi.symfony.cmo.de/httpdocs/branchenbuch/web/back end_dev.php
SCRIPT_NAME: /branchenbuch/web/backend_dev.php
SERVER_ADDR: 81.90.33.15
SERVER_ADMIN: dlugi@cmo.de
SERVER_NAME: dlugi.symfony.cmo.de
SERVER_PORT: '80'
SERVER_PROTOCOL: HTTP/1.1
SERVER_SIGNATURE: "
Apache/2.2.3 (CentOS) Server at dlugi.symfony.cmo.de Port 80
\n"
SERVER_SOFTWARE: 'Apache/2.2.3 (CentOS)'
session:
symfony/user/sfUser/attributes: { symfony/user/sfUser/attributes: { filter_active: 0, search: null, search_inside: true, item_id: null } }
symfony/user/sfUser/authenticated: false
symfony/user/sfUser/credentials: { }
symfony/user/sfUser/culture: en
symfony/user/sfUser/lastRequest: 1215086275

symfony v.1.1.0 - php 5.1.6
for help resolving this issue, please visit http://www.symfony-project.org/.
Re: An internal URI must contain a module and an action -> full stack trace [message #55428 is a reply to message #55419 ] Thu, 03 July 2008 15:28 Go to previous messageGo to next message
mdlugi  is currently offline mdlugi
Messages: 8
Registered: July 2008
Junior Member
Problem solved.

Got some links in the layout which weren't setted correctly.
They had no action.

Greetz
Matthias
Re: An internal URI must contain a module and an action [message #55457 is a reply to message #55418 ] Fri, 04 July 2008 07:21 Go to previous messageGo to next message
volod  is currently offline volod
Messages: 85
Registered: June 2008
Member
Can you, please, share your solution?
I have almost similar problem http://www.symfony-project.org/forum/index.php/t/13926/, but with '/short_url' links.


Vladimir Bilyov Websites development and support, Design, SEO
Re: An internal URI must contain a module and an action [message #55462 is a reply to message #55457 ] Fri, 04 July 2008 09:38 Go to previous messageGo to next message
mdlugi  is currently offline mdlugi
Messages: 8
Registered: July 2008
Junior Member
The Solution for the problem is just changing each link

example:

instead of link_to('example','module')
or link_to('example','/short_url')

you have to use the new convention:

link_to('example','module/action');

this is a workaround for the routing system.
Symply change ALL! links and it will work fine
Re: An internal URI must contain a module and an action [message #55471 is a reply to message #55418 ] Fri, 04 July 2008 11:17 Go to previous messageGo to next message
avorobiev  is currently offline avorobiev
Messages: 11
Registered: August 2007
Location: Russia
Junior Member

And I have found one difference between link_to() in 1.0 and 1.1.
In 1.0 was possible set link_to('name','/') - it points at the main page, like <a href="/">name</a>.
In 1.1 it's impossible.
Re: An internal URI must contain a module and an action [message #55474 is a reply to message #55471 ] Fri, 04 July 2008 11:30 Go to previous messageGo to next message
volod  is currently offline volod
Messages: 85
Registered: June 2008
Member
I did some debug and resolved that problem: did a patch
You can see it here: http://www.symfony-project.org/forum/index.php/m/55468/#msg_ 55468


Vladimir Bilyov Websites development and support, Design, SEO
Re: An internal URI must contain a module and an action [message #55475 is a reply to message #55462 ] Fri, 04 July 2008 11:33 Go to previous message
volod  is currently offline volod
Messages: 85
Registered: June 2008
Member
mdlugi wrote on Fri, 04 July 2008 10:38

The Solution for the problem is just changing each link

example:

instead of link_to('example','module')
or link_to('example','/short_url')

you have to use the new convention:

link_to('example','module/action');

this is a workaround for the routing system.
Symply change ALL! links and it will work fine


Hmm... once I was able to have short links, why should I refuse? Smile
I did a fix for it, but also got an idea: code like link_to('example', '/example/') should work (that's based on my code research and should work w/o my patch)


Vladimir Bilyov Websites development and support, Design, SEO
Previous Topic:routing problem with links like: /login
Next Topic:Unable to deploy from live server to local xampp
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software