Voyager: ErrorException in Controller.php line 178: Undefined variable: resize_width

Created on 4 May 2017  路  10Comments  路  Source: the-control-group/voyager

  • Laravel Version: 5.4.21
  • Voyager Version: 0.11.10
  • PHP Version: 7.0

Description:

After create a BREAD, when i try to insert something i get this error:

screen shot 2017-05-04 at 17 54 38

Steps To Reproduce:

Most helpful comment

Hi @raidenn this is a bug from the new version of Voyager (0.11.10)

When inserting multiple_images type, there is a bug on the code where, at least, the $resize_width and the $resize_height variables are not declared.

Wait for the "bug correction version", use custom code or use a previous version...

in my case I added the following code before that specific line:

if (isset($options->resize) && isset($options->resize->width) && isset($options->resize->height)) {
          $resize_width = $options->resize->width;
          $resize_height = $options->resize->height;
} else {
          $resize_width = 1800;
          $resize_height = null;
}

All 10 comments

Hi @raidenn this is a bug from the new version of Voyager (0.11.10)

When inserting multiple_images type, there is a bug on the code where, at least, the $resize_width and the $resize_height variables are not declared.

Wait for the "bug correction version", use custom code or use a previous version...

in my case I added the following code before that specific line:

if (isset($options->resize) && isset($options->resize->width) && isset($options->resize->height)) {
          $resize_width = $options->resize->width;
          $resize_height = $options->resize->height;
} else {
          $resize_width = 1800;
          $resize_height = null;
}

The style for thumbnail is also broken in dashboard. Images show in large size.

I have send in pull request #1214 for this and it still pending

Exactly @siryur this my alternative solution: HERE
Thanks @siryur :+1:

@siryur so you edited the vendor file ? vendor/tcg/voyager/src/Http/Controllers/Controller.php

Is there a fix yet? 0.11.14 version

Without multiple_images details field error exists, also with resize width and height null - also exists.

Yes, the fix was merged into master a while back. We haven't released it yet for a number of reasons, but it will be included in v1.0. I caution you against running dev-master right now as it's unstable while we prepare for 1.0

Labels: bug

Close (bug no longer occurs in 1.0)

Can be closed

This issue has been automatically locked since there has not been any recent activity after it was closed. If you have further questions please ask in our Slack group.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rayqiri picture rayqiri  路  3Comments

ferrywae picture ferrywae  路  4Comments

winex01 picture winex01  路  3Comments

raoasifraza1 picture raoasifraza1  路  3Comments

TXRRNT picture TXRRNT  路  3Comments