Shutter does not start in Ubuntu 16.04 LTS Final Beta

Bug #1563341 reported by Ferdinand Prantl
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Shutter
New
Undecided
Unassigned

Bug Description

When starting the shutter from the Dash, nothing happens. When starting it from the command line, it prints an error:

$ shutter
Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at /usr/bin/shutter line 3727.

I upgraded to the final beta of 16.04 LTS and updated the packages on March 28:

Package: shutter
Version: 0.92-0.1ubuntu1

Revision history for this message
Ferdinand Prantl (prantlf) wrote :

This appears to be caused by upgrading perl in xenial. Checking for an empty array should not used the `defined` keywoed any more. See http://blogs.perl.org/users/rurban/2012/02/on-definedarray-and-definedhash.html, for example. The following change in /usr/bin/shutter fixes the problem:

@@ -3723,7 +3723,7 @@
                 #edit
                 if ( $n_items
                     && defined $key
- && defined @{ $session_screens{$key}->{'undo'} }
+ && @{ $session_screens{$key}->{'undo'} }
                     && scalar @{ $session_screens{$key}->{'undo'} } > 1 )
                 {
                     $sm->{_menuitem_undo}->set_sensitive(TRUE);
@@ -3734,7 +3734,7 @@

                 if ( $n_items
                     && defined $key
- && defined @{ $session_screens{$key}->{'redo'} }
+ && @{ $session_screens{$key}->{'redo'} }
                     && scalar @{ $session_screens{$key}->{'redo'} } > 0 )
                 {
                     $sm->{_menuitem_redo}->set_sensitive(TRUE);

Revision history for this message
Ferdinand Prantl (prantlf) wrote :

The patch above caused the following error later:

*** Can't use an undefined value as an ARRAY reference at /usr/bin/shutter line 3735.

which made all context menu items greyed out. An improved patch, which fixes the context menu display, follows:

@@ -3723,7 +3723,7 @@
                 #edit
                 if ( $n_items
                     && defined $key
- && defined @{ $session_screens{$key}->{'undo'} }
+ && $session_screens{$key}->{'undo'}
                     && scalar @{ $session_screens{$key}->{'undo'} } > 1 )
                 {
                     $sm->{_menuitem_undo}->set_sensitive(TRUE);
@@ -3734,7 +3734,7 @@

                 if ( $n_items
                     && defined $key
- && defined @{ $session_screens{$key}->{'redo'} }
+ && $session_screens{$key}->{'redo'}
                     && scalar @{ $session_screens{$key}->{'redo'} } > 0 )
                 {
                     $sm->{_menuitem_redo}->set_sensitive(TRUE);

summary: - Shutter does not start in xenial
+ Shutter does not start in 16.04 LTS Final Beta
summary: - Shutter does not start in 16.04 LTS Final Beta
+ Shutter does not start in Ubuntu 16.04 LTS Final Beta
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.