Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleting/saving attached files gives Whoops #205

Closed
sebadamus opened this issue Feb 1, 2018 · 4 comments
Closed

Deleting/saving attached files gives Whoops #205

sebadamus opened this issue Feb 1, 2018 · 4 comments
Labels
Milestone

Comments

@sebadamus
Copy link

sebadamus commented Feb 1, 2018

Strange... now I have the latest commit updated on my site, test it again like this:

  1. went to company list, click on edit (the only one I have)

  2. there is shown the company image logo filename and the X to delete it.
    captura
    Here database after saving/deleting/saving/deleting, no human intervention :-), one is .png just for trying to solve it, works the first time, then the same)
    captura1

  3. click on the X and I get the Whoops error message again (I post it at the bottom)

Notice that the filename gets a (1)... (2)...etc, seems like it found a file with the same name and adds a (n) at the end, I guess that this number is not recorded right in the db or miss sync someway (just guessing)

Notice that the real filename is without the (n) at the end...

Also, easy to test... just try to completely delete the company image, so it would go back to the original default companies image, you cant (at least in my installation...)

Thanks,

(maybe related to #194 and #192)

`
(1/1) ErrorException Trying to get property of non-object

in Uploads.php (line 86)
at HandleExceptions->handleError(8, 'Trying to get property of non-object', '/var/www/html/akaunting/app/Http/Controllers/Common/Uploads.php', 86, array('media' => null))in Uploads.php (line 86)
at Uploads->getPath(null)in Uploads.php (line 43)
at Uploads->download('4')
at call_user_func_array(array(object(Uploads), 'download'), array('id' => '4'))in Controller.php (line 55)
at Controller->callAction('download', array('id' => '4'))in ControllerDispatcher.php (line 44)
at ControllerDispatcher->dispatch(object(Route), object(Uploads), 'download')in Route.php (line 203)
at Route->runController()in Route.php (line 160)
at Route->run()in Router.php (line 572)
at Router->Illuminate\Routing{closure}(object(Request))in Pipeline.php (line 30)
at Pipeline->Illuminate\Routing{closure}(object(Request))in SetLocale.php (line 94)
at SetLocale->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in AddXHeader.php (line 18)
at AddXHeader->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in LoadCurrencies.php (line 43)
at LoadCurrencies->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in LoadSettings.php (line 58)
at LoadSettings->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in RedirectIfNotInstalled.php (line 21)
at RedirectIfNotInstalled->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in SubstituteBindings.php (line 41)
at SubstituteBindings->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in Authenticate.php (line 43)
at Authenticate->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in VerifyCsrfToken.php (line 65)
at VerifyCsrfToken->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in ShareErrorsFromSession.php (line 49)
at ShareErrorsFromSession->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in StartSession.php (line 64)
at StartSession->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in AddQueuedCookiesToResponse.php (line 37)
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in EncryptCookies.php (line 59)
at EncryptCookies->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in Pipeline.php (line 102)
at Pipeline->then(object(Closure))in Router.php (line 574)
at Router->runRouteWithinStack(object(Route), object(Request))in Router.php (line 533)
at Router->dispatchToRoute(object(Request))in Router.php (line 511)
at Router->dispatch(object(Request))in Kernel.php (line 176)
at Kernel->Illuminate\Foundation\Http{closure}(object(Request))in Pipeline.php (line 30)
at Pipeline->Illuminate\Routing{closure}(object(Request))in Debugbar.php (line 51)
at Debugbar->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in TrustProxies.php (line 56)
at TrustProxies->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in TransformsRequest.php (line 30)
at TransformsRequest->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in TransformsRequest.php (line 30)
at TransformsRequest->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in ValidatePostSize.php (line 27)
at ValidatePostSize->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in CheckForMaintenanceMode.php (line 46)
at CheckForMaintenanceMode->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in Request.php (line 111)
at Request->handle(object(Request), object(Closure))in Pipeline.php (line 148)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in Pipeline.php (line 102)
at Pipeline->then(object(Closure))in Kernel.php (line 151)
at Kernel->sendRequestThroughRouter(object(Request))in Kernel.php (line 116)
at Kernel->handle(object(Request))in index.php (line 27)
`

@sebadamus
Copy link
Author

sebadamus commented Feb 1, 2018

Here fresh process without file in upload folder, without record in gp1_media:

  1. edit company, add a new image name1.jpg
    Database OK gp1_media, shows the filename (here copy/paste phpmyadmin, no columns)
    9 | uploads | 1/settings | CasasARG | jpg | image/jpeg | image | 5474 | 2018-02-01 16:20:05 | 2018-02-01 16:20:05 | NULL
    Upload folder OK, shows the right filename like the database.

  2. edit company, click on X to delete, shows popup to check you sure, click on "delete", popup goes away, but the logo image box still shows the filename and the X to delete the image.
    Database NOT OK, still shows the filename.
    Upload folder OK, the file is deleted.

  3. the logo is not shown anymore web up-left corner. If you try to go Companies, edit the company, repeat 2), but this time it gives the Whoops posted before.

  4. If you try to re-upload the same image (same filename) it gives Whoops and the file is uploaded again with right filename to the upload folder.

  5. If you upload a different filename image, it works, db is ok and upload filename, too. But remains the first one also.

Hope to explain myself right...

@sebadamus sebadamus changed the title Deleting/saving image in Company page gives Whoops... Deleting/saving attached files gives Whoops Feb 1, 2018
@sebadamus
Copy link
Author

I test attaching also .pdf files for i.e. with an expense, and with the same procedure I did with images in companies... happens the same.

Might be a problem with the upload/delete funciton, or just my installation (but have try with Ubuntu and Windows WAMP, so might be a function :-x)

@denisdulici
Copy link
Member

Are you able to reproduce with other uploads but logo?

@sebadamus
Copy link
Author

sebadamus commented Feb 5, 2018

Yes, attaching pdf files for with Expenses... (I post it before your response) if you like I test every other module? (but seems a whole upload function problem)

And one more thing just figured out, if you delete the company logo, there remains the image ID inside this table/record: gp1_settings.general.general.company_logo = 14, so you if you dont delete these records the company logo wont go back to default logo "that blue building", instead it leaves de defaul "no image/not found" from the browser.

@cuneytsenturk cuneytsenturk added this to the 1.1.11 milestone Feb 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants