tomaszsita / wp-manual-image-crop

Repository of WordPress image cropping plugin http://wordpress.org/plugins/manual-image-crop/
67 stars 41 forks source link

Notice: Undefined index: #12

Open craigmdennis opened 10 years ago

craigmdennis commented 10 years ago

Using Wordpress 3.9.2 on PHP Version 5.4.24

I installed the plugin and when I visit its dedicated page I get the following errors.

Notice: Undefined index: thumbnail in /Users/craigmdennis/Sites/localwhistler.com/content/plugins/manual-image-crop/lib/ManualImageCropSettingsPage.php on line 169

Notice: Undefined index: thumbnail in /Users/craigmdennis/Sites/localwhistler.com/content/plugins/manual-image-crop/lib/ManualImageCropSettingsPage.php on line 174

Notice: Undefined index: thumbnail in /Users/craigmdennis/Sites/localwhistler.com/content/plugins/manual-image-crop/lib/ManualImageCropSettingsPage.php on line 175

Notice: Undefined index: thumbnail in /Users/craigmdennis/Sites/localwhistler.com/content/plugins/manual-image-crop/lib/ManualImageCropSettingsPage.php on line 176

Notice: Undefined index: thumbnail in /Users/craigmdennis/Sites/localwhistler.com/content/plugins/manual-image-crop/lib/ManualImageCropSettingsPage.php on line 177

Notice: Undefined index: thumbnail in /Users/craigmdennis/Sites/localwhistler.com/content/plugins/manual-image-crop/lib/ManualImageCropSettingsPage.php on line 178

Notice: Undefined index: thumbnail in /Users/craigmdennis/Sites/localwhistler.com/content/plugins/manual-image-crop/lib/ManualImageCropSettingsPage.php on line 180

When using the 'crop' button in the media library I get the following errors:

Notice: Undefined index: thumbnail in /Users/craigmdennis/Sites/localwhistler.com/content/plugins/manual-image-crop/lib/ManualImageCropEditorWindow.php on line 48
Thumbnail
Notice: Undefined index: medium in /Users/craigmdennis/Sites/localwhistler.com/content/plugins/manual-image-crop/lib/ManualImageCropEditorWindow.php on line 48

Notice: Undefined index: large in /Users/craigmdennis/Sites/localwhistler.com/content/plugins/manual-image-crop/lib/ManualImageCropEditorWindow.php on line 48

Notice: Undefined index: media--featured in /Users/craigmdennis/Sites/localwhistler.com/content/plugins/manual-image-crop/lib/ManualImageCropEditorWindow.php on line 48

Notice: Undefined index: media--card in /Users/craigmdennis/Sites/localwhistler.com/content/plugins/manual-image-crop/lib/ManualImageCropEditorWindow.php on line 48

Notice: Undefined index: media--thumb in /Users/craigmdennis/Sites/localwhistler.com/content/plugins/manual-image-crop/lib/ManualImageCropEditorWindow.php on line 48
Saxafrass commented 10 years ago

Same issue on remote server. Also - when I added the plugin on my localhost it seems to work fine (no errors thrown) but the only cropping options I have are Thumbnail and My Custom Image.

ialocin commented 9 years ago

Seems like this is fixed for the ManualImageCropEditorWindow.php by adding:

if ( ! isset($sizesSettings[$s]) ) {
    $sizesSettings[$s] = array('label' => '', 'quality' => 80, 'visibility' => 'visible');
}

See in source

The problem persists for the ManualImageCropSettingsPage.php as there are not options set and ergo no options can be retrieved, it can easily be fixed by adding above code right after the foreach call on line 153 in ManualImageCropSettingsPage.php.

This should be part of the next plugin version as the settings page isn't usable otherwise.