Enable usage statistics plugin on OJS 3.3.0-10

Hello. Another question, sorry.

OJS 2.4 → OJS 3.1 → OJS 3.3.0-10

We want enable, as admin, the usage statistics plugin, but in web we can’t, checkbox is disabled

Captura de pantalla -2022-06-03 07-35-06

> SELECT * FROM plugin_settings WHERE setting_name='enabled' AND plugin_name='UsageStatsPlugin';
+------------------+------------+--------------+---------------+--------------+
| plugin_name      | context_id | setting_name | setting_value | setting_type |
+------------------+------------+--------------+---------------+--------------+
| usagestatsplugin |          0 | enabled      | 0             | bool         |
+------------------+------------+--------------+---------------+--------------+
1 row in set (0.001 sec)

How can i enable it?

Thank you.

That’s a site-wide plugin, so needs to be enabled by a Site Administrator.

First time was not obvious to me too. :wink:

Cheers,
m.

1 Like

Gracias Marc por su respuesta, perdón por el castellano, me es más fluido para poder explicar.

El problema parece estar que con el usuario que intento activarlo, es el administrador, tiene incluso en la base de datos el id=1.

He probado a darle todos los roles/permisos a este admin, pero sigue sin poderse activar el plugin de estadísticas de uso.

¿Si lo fuerzo en la base de datos, la activación del plugin, funcionará? Gracias.


Thanks Marc. Sorry for spanish.

The problem is that, the user is the site administrator, with id=1 in database.

I tried to give all roles to this user, but nothing.

Thanks.

Hello @asmecher @bozana , sorry, can you give me some light?

log. No new data:

/pkpfiles/usageStats/usageEventLogs# ls
usage_events_20161103.log

More information. stats/publications/publications no data

imagen

Table metrics
imagen
imagen

I try to enable the plugin on database, but didn’t work.

Thanks.

scheduled_tasks table

imagen

Can i do?, momentarily, to edit

UsageStatsPlugin.inc.php

        function getCanEnable() {
                return !((bool) Application::get()->getRequest()->getContext());
        }

by

        function getCanEnable() {
                #return !((bool) Application::get()->getRequest()->getContext());
                return 1;
        }

And then can i enable the plugin?

I hope it is okay if i continue in this older thread. I am encountering the same issue with one of our Journals (OJS 3.3.0.13, but originally setup with 3.1.0.1 and updated to many versions in between). The checkbox to enable the usageStats Plugin just remains grey and can not be clicked, even when logged in with the admin account. Therefore i was wondering if you found a solution for problem @juanito ?

hello @thf , how are you?

The solution is this

Do you need more info? I made it a little short

Thank you.

Yes, i actually got it working like this – Thank you! I do feel like having to edit a source file is maybe not the best “final solution” though. It seems to me, like this might be some kind of bug. In OJS installations that started off with a later version this plugin is enabled by default and can not be enabled. The check seems to ensure that you can only change this setting if you’re not in the context of a specific journal; but i was not able to find a site-wide config menu for this either. Anyway, now it works!

more info

1 Like