MDL-61667 analytics: Fix checking that a given model does not exist
authorDavid Mudrák <david@moodle.com>
Tue, 12 Mar 2019 08:09:26 +0000 (09:09 +0100)
committerDavid Mudrák <david@moodle.com>
Mon, 1 Apr 2019 12:23:06 +0000 (14:23 +0200)
commitaa8af6fcfc11d47fe3f8e25338c621e8bc778f4b
treeb40b40bd96bd3e1eff487c90481565d3e087e8a0
parent3b7c7918f3a4bb03e03816dba0df2506f33d6c3d
MDL-61667 analytics: Fix checking that a given model does not exist

The original implementation did not work well for checking that the
given model does NOT exist. If no record was found in the
analytics_models table, the code execution continued and it reached the
moment when indicators were checked. If no indicators were provided, the
call ended up with error 'array_keys() expects parameter 1 to be array,
boolean given' (because indicators were set to false).
analytics/classes/model.php
analytics/tests/manager_test.php
analytics/tests/model_test.php