Dashboard for Nextcloud by flost and Holger (was: Anyone in for an Overview / Dashboard / Start page app?)

No, no need for app framework afaik. (remember, this stuff is new for me as well
:wink:
All in all it looks like the tables were not created at first activation. (Have you checked it on the database - it might be that the table is there but with no rows. The query explicit asks for a row with wid ‘dummy’ )
But shouldn’t be there errors when initialization fails?!?
I’m running Postgres here, maybe I should test with MySQL as well.

I am very well aware that all this is new to you and I didn’t mean to build up any pressure. Quite the contrary really: I am super grateful you started this venture although you are not feeling to comfy with it yet. So thanks again :slight_smile: and sorry if I came across demanding or assuming. This was not at all intended.

Yes the tables are not created as mentioned earlier: as to WHY is still beyond me. Right now I try to figure out how to create them manually, but as of yet I failed to find an SQL file or any documentation on how to setup the the tables.

John

You got me totally wrong here - it was no complaint but more an excuse that I can not help immediately.

It looks like I have to test with MySQL to find the reason. I don’t know if I can manage it tonight (while looking the soccer match
) otherwise it might take the weekend.

No worries, I was just making sure not to have stepped on anyone’s toes :wink: my rule of thumb: If in doubt, bring it up and get it out of the way

Take your time please: as mentioned before, I run a test installation (meanwhile two of them) so no production is halted and nothing else important is failing :wink:

I just installed the git version a few minutes ago.
After raising the maximum PHP version (running on 7.0.8), I can enable the app and add a widget.
But it’s not saved, if I relaunch the dashboard, it pops up the widget selector again.

In my logfiles I get a lot of errors:

Error PHP Undefined variable: widget at /var/www/localhost/htdocs/nextcloud/apps/dashboard/templates/admin-settings.php#28 2016-07-07T10:53:32+00:00
Error PHP Undefined variable: widget at /var/www/localhost/htdocs/nextcloud/apps/dashboard/templates/admin-settings.php#28 2016-07-07T10:53:32+00:00
Error PHP Undefined variable: widget at /var/www/localhost/htdocs/nextcloud/apps/dashboard/templates/admin-settings.php#28 2016-07-07T10:53:32+00:00
Error PHP Undefined variable: widget at /var/www/localhost/htdocs/nextcloud/apps/dashboard/templates/admin-settings.php#25 2016-07-07T10:55:46+00:00
Error PHP Undefined variable: widget at /var/www/localhost/htdocs/nextcloud/apps/dashboard/templates/admin-settings.php#25 2016-07-07T10:55:46+00:00
Error PHP Undefined variable: widget at /var/www/localhost/htdocs/nextcloud/apps/dashboard/templates/admin-settings.php#19 2016-07-07T10:55:46+00:00
Error PHP Undefined variable: widget at /var/www/localhost/htdocs/nextcloud/apps/dashboard/templates/admin-settings.php#16 2016-07-07T10:55:46+00:00
Error PHP Undefined variable: widget at /var/www/localhost/htdocs/nextcloud/apps/dashboard/templates/admin-settings.php#28 2016-07-07T10:53:32+00:00
Error PHP Undefined variable: widget at /var/www/localhost/htdocs/nextcloud/apps/dashboard/templates/admin-settings.php#28 2016-07-07T10:53:32+00:00
Error PHP Undefined variable: widget at /var/www/localhost/htdocs/nextcloud/apps/dashboard/templates/admin-settings.php#28 2016-07-07T10:53:32+00:00
Error PHP Undefined variable: widget at /var/www/localhost/htdocs/nextcloud/apps/dashboard/templates/admin-settings.php#25 2016-07-07T10:53:32+00:00
Error PHP Undefined variable: widget at /var/www/localhost/htdocs/nextcloud/apps/dashboard/templates/admin-settings.php#25 2016-07-07T10:53:32+00:00
Error PHP Undefined variable: widget at /var/www/localhost/htdocs/nextcloud/apps/dashboard/templates/admin-settings.php#19

Thanks for testing!
I get this Error as well but it does not have any impact on my system.
But your results are already better then Johns

What database do you use?

I’m running mysql-5.6.30

Than the issue cannot solely be due to MySQL at least. @Holger are you using Path/nextcloud as well? I’m not.

ÄÀÀÀh Path/nextcloud? What’s this?

Meh, forget that. I was thinking whether the problems may be caused by a hardcoded path. But I disregarded that the app was designed for owncloud not nextcloud. Alas it would not have worked for either of us


/var/www/localhost/htdocs/nextcloud :wink:

Oh, that easy
 thanks for enlightenment;-)

Ok, good news
sort of


I managed to create the required tables manually (empty) and was able to activate the app and run the clock widget (for starters)

I also don’t see any error in the NC log.

Alas, it all seems to come down to making the app create the necessary tables (again)

John

For your convinience: here’s my SQL

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

CREATE TABLE IF NOT EXISTS `oc_dashboards` (
  `d_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `oc_uid` varchar(64) NOT NULL DEFAULT ' ',
  `div_id` varchar(64) NOT NULL DEFAULT ' ',
  `d_appid` varchar(255) NOT NULL DEFAULT ' ',
  `d_file` varchar(255) NOT NULL DEFAULT ' ',
  `d_js` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`d_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

CREATE TABLE IF NOT EXISTS `oc_dashboard_config` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `wid` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `wno` int(11) NOT NULL,
  `key` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `value` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;

CREATE TABLE IF NOT EXISTS `oc_dashboard_used_hashs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `used_hash` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
  `wiid` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `user` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `timestamp` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;

CREATE TABLE IF NOT EXISTS `oc_dashboard_widgets` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `wid` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `app_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `controller_service_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `template_service_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `js_paths` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `css_paths` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `enabled_groups` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `special` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;

Update:
like @groovy it doesn’t save the selected widget for me either.
unline @groovy I don’t get the error s/he mentioned. instead I get flooded with

Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. at Unknown#0

now.

Which is supposed to be dine by the database.xml during install.
At least the table is in there. Strange that this one is missing and the others are there?
Needs to be a typo somewhere

I fixed one more error. In the admin-template there were <? and <?php tags mixed which leads - at least in php5 - to not getting the widgets variable into the template.
After that I reenabled the selection of “widgets available for groups” in the admin panel.
This has to be done to show the widgets in the ‘available widgets’ page.
The error PHP Undefined variable: widget at... should be gone now.
[edit] and permanently adding widgets should work now [edit]

1 Like

If I understand it right, @groovy did not complain about missing tables. (He’s on MySQL as well) and in my fresh installation (PostgreSQL) all tables are there too.

This is for another evening;-) It’s only depecated and hopefully will not cause any problems after the recent fixes.

That’s fine. Wanted to note it down somewhere mainly for tracking reasons :wink:

Now that the admin-section is functional again (see below), wouldn’t it be best to set the ‘all’ group (for non german speakers ‘alle’ in the screenshot below :wink: ) as a default when a new widget is added?
On the one hand I don’t like to see an empty selection screen at first start, on the other hand it makes no sense to show a unser an e-Mail widget when he’s not allowed to use an email app because he’s not in the appropriate group?

What do you think?

Holger