Closed bAndie91 closed 9 months ago
Hi
Can you provide more info like sqlite and php version?
$filterArray should contain the table column names like this
$filterArray = [
'admin_id' => [
't' => 'INTEGER',
'd' => NULL,
'n' => true,
],
'username' => [
't' => 'TEXT',
'd' => '',
'n' => true,
],
'role_id' => [
't' => 'INT',
'd' => 'NULL',
'n' => true,
],
'token' => [
't' => 'TEXT',
'd' => '',
'n' => true,
],
];
$params['admin']= $this->db->filter($params['admin'], $filterArray,false);
I think there is a problem with system/db/sqlite->getColumnsMeta
with your sqlite version.
getColumnsMeta
runs this query to get column names
SELECT type as t, name, dflt_value as d, `notnull` as n FROM pragma_table_info('admin');
The code will be pushed to github after beta is over and bug fixes, refactoring and code cleanup is complete.
it's PHP 8.2.10 (cli) (built: Sep 4 2023 08:11:43) (NTS)
with php8.2-sqlite3 8.2.10-1+0~20230904.33+debian11~1.gbp2dc84c
i deleted storage/model/install/adminsql.sqlite.php
and it got re-generated with $filterArray
filled up.
…but now it gives this on the admin panel:
Call to undefined method Vvveb\Sql\StatSQL::getOrdersCount()
/srv/web/vvveb/hmvhp/admin/controller/base.php on line 453
Code
$orderCount = $stats->getOrdersCount($this->global); // <==
$menu = array_insert_array_after('edit', $menu, $posts_menu);
//products -- add to menu
$products_menu = $this->customProducts();
$menu = array_insert_array_after('sales', $menu, $products_menu);
$stats = new StatSQL();
$orderCount = $stats->getOrdersCount($this->global); // <==
$orderStatsusNew = 1;//get from site config
$newOrders = ($orderCount['orders'][$orderStatsusNew]['count'] ?? 0);
if ($newOrders > 0) {
$menu['sales']['badge'] = $newOrders;
$menu['sales']['badge-class'] = 'badge bg-primary-subtle text-body float-end';
Trace
#0 /srv/web/vvveb/hmvhp/system/core/frontcontroller.php(209): Vvveb\Controller\Base->init()
#1 /srv/web/vvveb/hmvhp/system/core/frontcontroller.php(297): Vvveb\System\Core\FrontController::call()
#2 /srv/web/vvveb/hmvhp/system/core/frontcontroller.php(362): Vvveb\System\Core\FrontController::redirect()
#3 /srv/web/vvveb/hmvhp/system/core/startup.php(365): Vvveb\System\Core\FrontController::dispatch()
#4 /srv/web/vvveb/hmvhp/index.php(144): Vvveb\System\Core\start()
#5 /srv/web/vvveb/hmvhp/admin/index.php(41): include('...')
#6 /srv/web/vvveb/hmvhp/public/admin/index.php(28): include('...')
#7 {main}
Thanks for feedback, I updated the generated model for sqlite install.
The code for getOrdersCount
was not updated for sqlite, please redownload the zip and update vvveb/admin/sql/sqlite/stat.sql
works. cool.
i'm installing vvveb with sqlite backend.
it brings me to the page where i enter the website name, then click "finish install".
seems like
$filterArray
is empty in$params['admin']= $this->db->filter($params['admin'], $filterArray,false);
also, where is the code in git?