- Issue created by @m_hobby
- Status changed to Fixed
6 months ago 8:29pm 23 May 2024 Automatically closed - issue fixed for 2 weeks with no activity.
When updating leaflet module and the civicrm_entity_leaflet to latest versions, and viewing an existing map view settings.
There is an error when trying to save or update any of the view display settings.
2024/05/22 12:33:01 [error] 1995417#1995417: *1363109 FastCGI sent in stderr: "PHP message: Uncaught PHP Exception TypeError: "uasort(): Argument #1 ($array) must be of type array, null given" at /var/www/html/x/drupal10/web/modules/contrib/civicrm_entity_leaflet-civicrm_entity_leaflet/src/Plugin/views/style/CivicrmEntityAddressLeafletMap.php line 702" while reading response header from upstream, client: 195.188.223.90, server: x, request: "POST /admin/structure/views/view/hive_directory/preview/block_2?_wrapper_format=drupal_ajax HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.1-fpm.sock:", host: "x", referrer: "x/admin/structure/views/view/x/edit/block_2"
2
This seems very similar to an issue that existed for leaflet and upgrading versions there
https://www.drupal.org/project/leaflet/issues/3375293
π¬
TypeError: uasort(): Argument #1 ($array) must be of type array, null given in uasort() (line 1218 of modules/contrib/leaflet/modules/leaflet_views/src/Plugin/views/style/LeafletMap.php).
Fixed
Set up a basic contact search view with contextual filter to URL and relationship to address.
Limit results to 1
View everything works as expected.
Update modules to latest
leaflet 10.2.x-dev
civicrm_entity_leaflet 2.0.x-dev
civicrm_entity 4.0.x-dev (unsure if this impacts things)
View the page where the map is displayed or try to modify the configuration
Add the check mentioned on the leaflet issue
// Order the data features based on the 'weight' element.
if ($features_group && count($features_group) > 1) {
// Order the data features groups based on the 'weight' element.
uasort($features_group, [
'Drupal\Component\Utility\SortArray',
'sortByWeightElement',
]);
}
Raising the MR from gitlab shortly.
Fixed
2.0
Code
Automatically closed - issue fixed for 2 weeks with no activity.