Closed aidonsnous closed 8 years ago
Hi, i create new release for this extension today. Please, try again setup this ext via composer.
I tried to install it again via composer here is what I get:
C:\wamp\www\fget>composer require --prefer-dist yii2mod/yii2-timezone "*"
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Failed to decode response: zlib_decode(): data error
Retrying with degraded mode, check https://getcomposer.org/doc/articles/troubleshooting.md#degraded-mode for more info
What about the support of DST ?
One Idea that I got was to download the new release zip file, extract and replace the file in the folder vendor\yii2mod\timezone with these new file. Before replacing I found the folder timezone has been renamed to yii2-timezone I try to rename it back and the tried to reload the page got the error class not exists then I understand what was the problem because putting it back as yii2-timezone no error. After replacing when reloading the page in google chrome I can see this error :
The requested URL /site/timezone was not found on this server.
But in my sitecontroller here is the actions method:
public function actions()
{
return [
'error' => [
'class' => 'yii\web\ErrorAction',
],
'captcha' => [
'class' => 'yii\captcha\CaptchaAction',
],
'timezone' => [
'class' => 'yii2mod\timezone\TimezoneAction',
],
];
}
Can't reproduce this error. Yesterday I tested this package on yii2-basic and everything worked without errors.
While debbuging my code I suspect in timezone class this code:
$.post("$actionRoute", {
timezone: timezone,
timezoneAbbr: timezoneAbbr,
timezoneOffset: -new Date().getTimezoneOffset() / 60
});
Since $actionRoute is not $actionRoute is not an url but an action route passing it as an url to jquery ajax function is what is causing the error:
`public $actionRoute = '/site/timezone';`
it should be Yii::$app->urlManager->createUrl(['site/timezone']) passed here:
$.post("$actionRoute",
If I try to set
$this->actionRoute = Yii::$app->urlManager->createUrl(['site/timezone']);
the page is being reloaded automatically without stopping.
That where I am stuck for now since I don't understand the code that's creating js code well.
I see that the page is being reloaded automatically without stopping.
You have been redirected to the login page?
It's maybe rbac, try to disable rbac module for site controller or add route to allow
section of AccessControl
Yeah I forgot to add it to allow section but now I've added but still getting :
The requested URL /site/timezone was not found on this server.
I also try to access one of the actions as $actionroute is set(I tried with site/index) but it could not work.
I update Timezone class, please update package via composer and check it.
Thanks it is working but add
use yii\helpers\Url;
In Timezone class file to avoid error about Url::toroute method
oh, thanks. I forgot about it.
Does the extension support DST ?
I am getting the below error when trying to install the extension:
I tried put adding the extension manually but the application is giving error message saying
What I did is :