[wp-trac] [WordPress Trac] #61114: PHP 8+ Fatal Error in WP_Upgrader due to TypeError in array_keys() Call

WordPress Trac noreply at wordpress.org
Fri Oct 11 20:09:25 UTC 2024


#61114: PHP 8+ Fatal Error in WP_Upgrader due to TypeError in array_keys() Call
-----------------------------+---------------------
 Reporter:  verygoode        |       Owner:  (none)
     Type:  defect (bug)     |      Status:  new
 Priority:  normal           |   Milestone:  6.7
Component:  Upgrade/Install  |     Version:  2.8
 Severity:  normal           |  Resolution:
 Keywords:  needs-patch      |     Focuses:
-----------------------------+---------------------

Comment (by lifelightweb):

 Forgive me if my request is out of line, but all my sites are pretty much
 dead in the water insofar as updates.  I'm seeing this problem across all
 my servers, across multiple accounts all PHP8.1 and the latest WP version.
 I cannot install a fresh plugin, I cannot update an existing one.  Doesn't
 matter how much disk space I have or how busy the server is.  For sure I'm
 not hitting memory errors on some of these servers as they were just
 recently upgraded.  This started literally this last week. I've never had
 this issue like this before.  It would seem to me that something has
 changed and broken WordPress for people like me.

 How does this get escalated to get some attention--this is getting very
 serious for me.

 Replying to [comment:12 azaozz]:
 > Replying to [comment:8 verygoode]:
 >
 > > Warning: Could not move the old version to the upgrade-temp-backup
 directory.
 >
 > Yep, I believe this is the right output when the plugin directory
 doesn't exist. Just wondering if it may be better to add a more
 [https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes
 /class-wp-upgrader.php#L606 specific error message there]? Maybe the patch
 should be something like:
 > {{{
 > // Has the source location changed? If so, we need a new source_files
 list.
 > if ( $source !== $remote_source ) {
 >       $dir_list = $wp_filesystem->dirlist( $source );
 >
 >       if ( empty( $dir_list ) ) {
 >               // Return new WP_ERROR
 >       }
 >
 >       $source_files = array_keys( $dir_list );
 > }
 > }}}
 >
 > This matches some of the existing code, see:
 https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/class-
 wp-upgrader.php#L366
 >
 > Moving to the 6.7 milestone for consideration.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/61114#comment:14>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list