Skip to content

Fatal Error: Uncaught TypeError: array_map(): Argument #2 ($array) must be of type array #164

@ds106dc

Description

@ds106dc

Seeing this error in 2 FeedWordPress sites I manage and google says I am not alone

This occurs on an attempt to update:

Updating WildDS106 - Connecting is Learning from
<https://connectingislearning.com/tag/wildds106/rss/> ...
Fatal error: Uncaught TypeError: array_map(): Argument #2 ($array) must be of type array,
WpOrg\Requests\Utility\CaseInsensitiveDictionary given in
/home/fabergla/combobulating.net/wp-includes/SimplePie/src/File.php:373 Stack trace: #0
/home/fabergla/combobulating.net/wp-includes/SimplePie/src/File.php(373):
array_map(Object(Closure), Object(WpOrg\Requests\Utility\CaseInsensitiveDictionary)) #1
/home/fabergla/combobulating.net/wp-includes/SimplePie/src/File.php(327):
SimplePie\File->maybe_update_headers() #2
/home/fabergla/combobulating.net/wp-includes/SimplePie/src/SimplePie.php(2093):
SimplePie\File->get_headers() #3
/home/fabergla/combobulating.net/wp-includes/SimplePie/src/SimplePie.php(1734):
SimplePie\SimplePie->fetch_data(Object(SimplePie\Cache\BaseDataCache)) #4
/home/fabergla/combobulating.net/wp-content/plugins/feedwordpress/feedwordpress.php(2019):
SimplePie\SimplePie->init() #5
/home/fabergla/combobulating.net/wp-content/plugins/feedwordpress/syndicatedlink.class.php(100):
FeedWordPress::fetch(Object(SyndicatedLink), Array) #6
/home/fabergla/combobulating.net/wp-content/plugins/feedwordpress/syndicatedlink.class.php(139):
SyndicatedLink->fetch() #7
/home/fabergla/combobulating.net/wp-content/plugins/feedwordpress/feedwordpress.php(918):
SyndicatedLink->poll(NULL) #8
/home/fabergla/combobulating.net/wp-content/plugins/feedwordpress/feedwordpresssyndicationpage.
class.php(1358): FeedWordPress->update(NULL, NULL) #9
/home/fabergla/combobulating.net/wp-content/plugins/feedwordpress/feedwordpresssyndicationpage.
class.php(1425): fwp_dashboard_update_if_requested(Object(FeedWordPressSyndicationPage)) #10
/home/fabergla/combobulating.net/wp-admin/includes/template.php(1453):
fwp_syndication_manage_page_update_box(Object(FeedWordPressSyndicationPage), Array) #11
/home/fabergla/combobulating.net/wp-content/plugins/feedwordpress/feedwordpresssyndicationpage.
class.php(592): do_meta_boxes(Object(WP_Screen), 'feedwordpresssy...',
Object(FeedWordPressSyndicationPage)) #12
/home/fabergla/combobulating.net/wp-content/plugins/feedwordpress/syndication.php(5):
FeedWordPressSyndicationPage->display() #13
/home/fabergla/combobulating.net/wp-admin/admin.php(298): include('/home/fabergla/...') #14 {main}
thrown in /home/fabergla/combobulating.net/wp-includes/SimplePie/src/File.php on line 373


Not that I rely on Google's Ai but this sounds plausible:

The error "Argument #2 ($array) must be of type array, WpOrg\Requests\Utility\CaseInsensitiveDictionary given" occurs in WordPress due to a type incompatibility between the older SimplePie library (used for RSS feeds) and the newer Requests library (used for HTTP requests), specifically in newer PHP versions.
The SimplePie\File->maybe_update_headers() function expects an array for its second argument, but it receives a WpOrg\Requests\Utility\CaseInsensitiveDictionary object from the Requests library, which PHP no longer automatically coerces into an array, causing a fatal TypeError

Is there even at least a quick fix one can do? Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions