[wp-trac] [WordPress Trac] #36501: Fatal error: Undefined class constant 'ALPHACHANNEL_UNDEFINED'

WordPress Trac noreply at wordpress.org
Wed Apr 13 05:06:23 UTC 2016


#36501: Fatal error: Undefined class constant 'ALPHACHANNEL_UNDEFINED'
--------------------------+-----------------------------
 Reporter:  gblsm         |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Media         |    Version:  4.5
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 After upgrading to WordPress 4.5 today, some people have reported that a
 Fatal error occurs when they upload an image through Admin > Media.
 {{{
 Fatal error: Undefined class constant 'ALPHACHANNEL_UNDEFINED' in
 /home/users/2/lolipop.jp-xxxxx/web/news/wp-includes/class-wp-image-editor-
 imagick.php on line 379
 }}}
 I found that the parameter for PHP’s define function caused the error. It
 should be quoted but is not done right now. The patch to this is attached.
 {{{
 if ( is_callable( array( $this->image, 'getImageAlphaChannel' ) )
         && is_callable( array( $this->image, 'setImageAlphaChannel' ) )
         && defined( 'Imagick::ALPHACHANNEL_UNDEFINED' )
         && defined( 'Imagick::ALPHACHANNEL_OPAQUE' )
 ) {
         if ( $this->image->getImageAlphaChannel() ===
 Imagick::ALPHACHANNEL_UNDEFINED ) {
                 $this->image->setImageAlphaChannel(
 Imagick::ALPHACHANNEL_OPAQUE );
         }
 }
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/36501>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list