Matomo v5.5.1 : Warning - Implicit conversion from float to int loses precision

After upgrade from v5.5.0 to v5.5.1

In CLI mode (e.g. running core:update) and in the backend.

WARNING core/Menu/MenuAbstract.php(108): Deprecated - Implicit conversion from float 40.5 to int loses precision

Not critical but someone should maybe take a look (e.g. use an explicit conversion).

P.S.

PHP v8.2
MariaDB 10.11.14

Update:

The cause is the change of the method signature of MenuAbstrart→addItem() in this recent commit:

Git Hub: /matomo-org/matomo/pull/23648 (sorry can’t post direct link)

And, at least in our case, the menu item with a float order value of 40.5 comes from the AdvertisingConversionExport plugin:

plugins/AdvertisingConversionExport/Menu.php line #33, in call to $menu->addMeasurableItem().

As AdvertisingConversionExport comes also from the core team, there needs to be some coordination here.

Either $order is allowed to be a float value in MenuAbstract or all plugins need to use an integer value when calling addItem()/addMeasurableItem().

having the same problem after updating

WARNING: /core/Menu/MenuAbstract.php(108): Deprecated - Implicit conversion from float 40.5 to int loses precision - Matomo 5.5.1 - Please report this message in the Matomo forums: (please do a search first as it might have been reported already) (Module: CorePluginsAdmin, Action: plugins, In CLI mode: false)

1 Like

Hey guys, we are aware of this issue. There should be a new release of the AdvertisingConversionExport plugin soon, which will fix the issue.

2 Likes

Given that the menu class is higjly likely to be used by 3rd party plugins, changing the signature of a public method in a patch-level release of the core is, as Sir Humphrey would say, “courageous”.