gocodebox / gocodebox/lifterlms

In llms.abstract.database.store.php, get() method is expecting read() method to always return an associate array even if read() will sometimes return a boolean.

Open
#2,930 2 comments 0 reactions 1 assignee Claimed by @ideadude View on GitHub
Dominant language
PHP
Stars
212
Forks
140
Avg merge
2d 14h
Merged PRs (30d)
19

Description

In `wp-content/plugins/lifterlms/includes/abstracts/llms.abstract.database.store.php`, Line 170 is expecting `$this->read( $key )` to always return an associative array. However, in the same `/wp-content/plugins/lifterlms/includes/abstracts/llms.abstract.database.store.php` file, the method `read()` defined in line 338 is allowed to return a false value, which is not an associative array. In other words, line 170 is not correct in expecting that the method `read()` will always return an associative array — hence the PHP warning. Note, however, that the `read()` method in `/wp-content/plugins/lifterlms/includes/abstracts/llms.abstract.database.store.php` is returning a false value since there is no corresponding session record in the `wp_lifterlms_events` database table.

### Reproduction Steps

None.

### Expected Behavior

Line 170 should not expect an associated array all the time, since a false can be returned.

### Actual Behavior

Line 170 should not expect an associated array all the time, even if a false can be returned.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.