Skip to content
This repository has been archived by the owner on Oct 20, 2023. It is now read-only.

Errore with promote() #33

Closed
igorfelluga opened this issue Apr 27, 2015 · 3 comments
Closed

Errore with promote() #33

igorfelluga opened this issue Apr 27, 2015 · 3 comments

Comments

@igorfelluga
Copy link

Hi
I have cakephp 2.6.4 and last stable plugin i18n
In a plugin I use:

Router::connect('/', array('controller' => 'questions', 'action' => 'home', 'plugin' => 'expo'), array('routeClass' => 'I18nRoute'));
Router::promote();

and with promote I get this error:

Notice (8): Undefined offset: -1 [APP/Plugin/I18n/Config/routes.php, line 44]
Warning (2): Attempt to modify property of non-object [APP/Plugin/I18n/Config/routes.php, line 47]
Warning (2): Attempt to modify property of non-object [APP/Plugin/I18n/Config/routes.php, line 47]
Notice (8): Undefined offset: -2 [APP/Plugin/I18n/Config/routes.php, line 44]
Warning (2): Attempt to modify property of non-object [APP/Plugin/I18n/Config/routes.php, line 47]
@andretefras
Copy link

Do you have any other connected routes @igorfelluga?

The error seems to happen because there are no previously connected routes.

This should not happen anyway. I will take a look.

@andretefras
Copy link

The error was caused because probably you were casting the Router::promote() before the CakePlugin::routes(). The i18n plugin will generate a lot of routes matching every available language to existent routes. So it is necessary to cast the Router::promote() after, ok?

@Megslalk
Copy link

Closing issue - please reopen if you require further assistance!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants