Sqlite plugin + shortcode weird error


#1

I have been trying for the last day to get the SQLite plugin (with shortcode dependency installed) and it keeps returning this error:

Whoops \ Exception \ ErrorException (E_WARNING)

Missing argument 2 for Grav\Plugin\Shortcodes\SqlTableShortcode::log(), called in C:\dev\repos\grav\server\www\scenarist\user\plugins\sqlite\shortcodes\SqlTableShortcode.php on line 16 and defined


Im very puzzled, and there are no obvious issues on the GitHub site relating to it.
Anyone who has any thoughts, it would be greatly appreciated.
Cheers,
David


#2

I have managed to find the issue. Looks like there is a bug in the SQLite php.
File: SqlTableShortcode.php line 16
$this->log($this->grav[‘sqlite’][‘error’]);

This log call should have two params. I changed it to this:
$this->log($this->grav[‘sqlite’][‘error’], $this->grav[‘sqlite’][‘error’]);

This seems to work - not sure if its technically correct.
At least the shortcode and the SQLite plugin is now working properly.


#3

Thank you for finding the issue.

The log function does indeed need two parameters, but the first should be self::ERROR

I have changed the code and added you to the credits in the README

A new version has just been released.