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

Stale references in lists #188

Closed
donotos opened this issue May 14, 2020 · 7 comments
Closed

Stale references in lists #188

donotos opened this issue May 14, 2020 · 7 comments

Comments

@donotos
Copy link

donotos commented May 14, 2020

Hi!

When i go to user menu > lists > planned i get an error 500. all the other lists works fine.

Thanks.

@pierobot
Copy link
Owner

Do you have a log?
I don't get an error on my end.

@donotos
Copy link
Author

donotos commented May 15, 2020

ok i'll activate dev mod and come back with more infos.

@donotos
Copy link
Author

donotos commented May 16, 2020

ErrorException (E_ERROR)
Trying to get property 'name' of non-object (View: /var/www/mangapie/resources/views/lists/planned.blade.php)

/var/www/mangapie/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php
     *
     * @param  string  $__path
     * @param  array   $__data
     * @return string
     */
    protected function evaluatePath($__path, $__data)
    {
        $obLevel = ob_get_level();
 
        ob_start();
 
        extract($__data, EXTR_SKIP);
 
        // We'll evaluate the contents of the view inside a try/catch block so we can
        // flush out any stray output that might get out before an error occurs or
        // an exception is thrown. This prevents any partial views from leaking.
        try {
            include $__path;
        } catch (Exception $e) {
            $this->handleViewException($e, $obLevel);
        } catch (Throwable $e) {
            $this->handleViewException(new FatalThrowableError($e), $obLevel);
        }
 
        return ltrim(ob_get_clean());
    }
 
    /**
     * Handle a view exception.
     *
     * @param  \Exception  $e
     * @param  int  $obLevel
     * @return void
     *
     * @throws \Exception
     */
    protected function handleViewException(Exception $e, $obLevel)
    {
        while (ob_get_level() > $obLevel) {
            ob_end_clean();
Arguments
ErrorException {#617 ▶}
1

@pierobot
Copy link
Owner

pierobot commented May 16, 2020

I don't think I'll need it in this case but try to provide the call stack in the future.

What happens if you run this in php artisan tinker?

Planned::whereDoesntHave('manga')->get();

@donotos
Copy link
Author

donotos commented May 16, 2020

[!] Aliasing 'Planned' to 'App\Planned' for this Tinker session.
=> Illuminate\Database\Eloquent\Collection {#3206
     all: [
       App\Planned {#3210
         id: 4,
         user_id: 2,
         manga_id: 278,
         created_at: "2020-05-13 14:22:17",
         updated_at: "2020-05-13 14:22:17",
       },
       App\Planned {#3200
         id: 6,
         user_id: 2,
         manga_id: 340,
         created_at: "2020-05-13 15:05:11",
         updated_at: "2020-05-13 15:05:11",
       },
     ],
   }

@pierobot
Copy link
Owner

pierobot commented May 16, 2020

Okay. Looks like some stale references to manga that no longer exists.
Do

Planned::whereDoesntHave('manga')->forceDelete();

I'll eventually make it so this doesn't happen.

@pierobot pierobot changed the title issue with planned list Stale references in lists May 16, 2020
@donotos
Copy link
Author

donotos commented May 16, 2020

it deleted 2 entries. works fine now.

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

No branches or pull requests

2 participants