404 Error - PluginHandler

Hi, all.
I am writing a plugin for extending std doi plugin, and I have a problem that I can’t solve for several hours.
I always get 404 error message when I try to use a custom handler.
I use LinkAction.tpl https://prnt.sc/qoqlun => register callBack handler https://prnt.sc/qoqmj7 => create handler https://prnt.sc/qoqnxj and got 404 error https://prnt.sc/qoqlh7
Where and what I should register to force to work this feature.

All hope is only for you =)

Hi @ak-alz,

Have a look at this thread: OJS 3 Does not Register Custom Plugin

Regards,
Alec Smecher
Public Knowledge Project Team

Hi! Thanks a lot for the link. But the plugin registered normal. In the version table, I have the right row. And main trouble is 404 error when I try to call a handler. Handler registered to, but its inner methods never called.

http://prntscr.com/qp3l9k => http://prntscr.com/qp3lqe => http://prntscr.com/qp3m30

Hi @ak-alz,

I would suggest adding some error_log calls to see how far your code is getting. For example, is the hook callback being reached? If so, is the handler class being initialized?

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks for the answer.

As I see handler never called. But the hook is on the list. http://prntscr.com/qp4yw2 => http://prntscr.com/qp4z6a

[17-Jan-2020 18:58:52 Europe/Moscow] register Hook
[17-Jan-2020 18:58:52 Europe/Moscow] after register Hook
[17-Jan-2020 18:58:55 Europe/Moscow] ojs2: 404 Not Found

Handler never called. http://prntscr.com/qp4wek

Hi @ak-alz,

OK, that does confirm that the plugin is registered correctly. I note that you’re trying to add a new function to an already-existing handler, which is something I haven’t tried; I would suggest checking to see if you can address the handler by its own URL, rather than trying to extend the existing FutureIssueGridHander (see the URL in your first set of screenshots).

Regards,
Alec Smecher
Public Knowledge Project Team

Sounds good, but I don’t know how to do it =)
I would love to use the documentation, but it does not exist in full volume =)

May you help me, or direct the right direction for digging?

Hi @ak-alz,

I would suggest looking at e.g. the static pages plugin as an example. The codebase is here, for the 3.1.2 branch (make sure you’re following the branch that corresponds with your version of OJS): https://github.com/pkp/staticPages/tree/stable-3_1_2

Regards,
Alec Smecher
Public Knowledge Project Team

Thank you very much. I’ll rewrite my plugin to that type.

And thanks again =)