frame

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Register
Hello m'Managerians !
What do you think m'Manager 2.0 should be ? What features SHOULD or MUST be implemented right now ! Request or Vote here

Php 7.2 count() issue

edited July 2018 in Bugs Report

Hi,
In Php 7.2 the count() function has been updated. If you get the following error after php upgrade, here is a quick fix

Warning:

A PHP Error was encountered

Severity: Warning

Message: count(): Parameter must be an array or an object that implements Countable

Fix: If you have not edited application/libraries/M_manager.php use the attached file. Unzip and upload. Or update the _init() function to look like this

$payment_methods = [];
$p_methods = get_payment_methods();

$inactiveItems = null == get_items('inactive') ? []: get_items('inactive');
$inactiveServices = null == get_services('inactive') ? []: get_services('inactive');
....
'countOverdueInvoices' => null == count_invoices('Overdue') ? '' : count_invoices('Overdue'),
'count_clients'         => null == count_clients('active') ? '': count_clients('active'),
'count_items'           => 0 == count($inactiveItems) ? '' : count($inactiveItems),
'count_services'            => 0 == count($inactiveServices) ? '' : count($inactiveServices),

Thanks
Eric

Tagged:

Comments

Sign In or Register to comment.

m'Manager

| Let's Build Together a Great App !
If you are a happy user, send me a coffee.
2015 - 2107 © m'Manager.
Powered by VanillaForums, Designed by ThemeSteam

Recent Donations

  • Joni Mueller from https://pixelita.com/ - 63€
  • HeyrmanD from https://locco-palace.be - 25€
  • Patricia from Sjopz.com - 10€
  • AskinSavascisi from wolftech.com - 3€
  • Get In Touch