gugoan/economizzer

Error 404 - editing expense record

ddr400 opened this issue ยท 16 comments

Hello,
When i try to edit some expense record, the application return the following error:

error

What could be the cause?

Please attach logs files for web server and php. It help to resolve problem.

Hello,
Where could i find that log's?
This is what i could see in the app.log file inside /runtime/logs folder:
sem titulo

@ddr400 , Try this:
Replace the content of the "rowOptions" param in your cashbook / index file with the content below and delete your .htaccess file

'rowOptions'   => function ($model, $index, $widget, $grid) {
                return [
                    'id' => $model['id'], 
                    'onclick' => 'location.href="'
                        . Yii::$app->urlManager->createUrl('cashbook/update') 
                        . '&id="+(this.id);',
                    'style' => "cursor: pointer",
                ];
        },       

I will try a definitive solution and publish it later.

Hello gugoan,
Thanks for the help!
Where is the cashbook / index file that you mentionned? I try to search in all folders and i didn't find it.

Best Regards,

It is located at: economizzer/views/cashbook/index.php
Take a test and let me know

Hello,
I made the test and it dosn't solve the issue.
Any other ideas?

Does the error only happen when changing a record?
How is the URL when clicking the record you want to change?

The issue happens when o try to change a record.
The url that appears in the bar is /r=cashbook/613

I got the same error when i try to edit an category (r=category/1013).

My instalation have the beautiful url= false.

Along with the tips I passed above, comment on the "urlManager" parameter in "economizzer/config/web.php".

        // 'urlManager' => [
        //     'class' => 'yii\web\UrlManager',
        //     'showScriptName' => false,
        //     'enablePrettyUrl' => true,
        //     'rules' => array(
        //             '<controller:\w+>/<id:\d+>' => '<controller>/view',
        //             '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
        //             '<controller:\w+>/<action:\w+>' => '<controller>/<action>',
        //             //'category/<id:\w+>' => 'category/view'
        //     ),
        // ],

The problem is happening because the URL's creation is considering that you are using enablePrettyUrl

Hello.
I comment thaat urmManager code and that also don't solve the error.
My initial issue is that i couldn't run the app with the enable prettyirl = true.
If i start to change a lot of parameters in the configurations, i will have issues in a future update.
How can i solve my issues? in the demo of the project all the spects works fine but in my local server no.
Thanks!

I'm trying to understand your environment where the application is installed to help you with the problem. The tests I asked for were just to understand that. We have to find out what the incompatibility is in your environment.

I have economizzer running normally on my pc (windows), my notebook (linux) and the cloud host (linux).

You're using linux, right? Is the "mod_rewrite" extension enabled? (It is required to use "prettyUrl").

Hello,
Thanks for the feedback.
I'm using debian under my raspberry pi (jasen).
If i have the pretty url on, when access the page, i got the 404 error page:

screenshot_1

I check and i have the module mod_rewrite active for apache.

I could give you the access to the server so you could check my environement if you need it.
Thanks!

This is caused by some APACHE configuration. It is not system bug.

Like PHPROCKS say, this is not a bug but an configuration issue of Apache.
Thanks guys. My issue is solved. Now it's time to make the translation to pt-PT and to publish it.

I'm glad it worked ๐Ÿ‘
hug