Issues porting ARK PubId Plugin to OJS 3.4: 404/500 errors on clearPubId and Issue Identifiers tab

Hi everyone,

I’m currently updating the ARK PubId Plugin for OJS 3.4.0-x. Most of the functionality (generation and assignment in publications, see old ARKs…) is working, but I’m facing two specific blockers regarding the management of existing identifiers and the Issue Identifiers tab.

1. 404 Error when clearing PubIds (Galleys/Articles): When attempting to use LinkAction with RemoteActionConfirmationModal to trigger clearPubId, OJS 3.4 returns a 404. It seems the request is being directed to the Grid Handler (e.g., article-galley-grid) which doesn’t recognize the clearPubId operation.

  • Question: In OJS 3.4, what is the recommended way to point LinkAction to the proper controller for deleting a PubId? Should we still use grid.settings.pubIds.PubIdPluginGridHandler or has this been moved to a different component?

2. 500 Error on Issue Identifiers Tab: When opening the “Identifiers” tab in the Issue Management modal, the console shows a 500 error: GET .../grid/issues/back-issue-grid/identifiers?issueId=XX This seems to happen because the plugin’s hooks into the identifier forms are expecting a Publication object which is absent in the Issue context.

3. Fatal Error - Abstract Methods: I’ve noticed that PKPPubIdPlugin now requires several abstract methods that were optional or different in 3.3 (e.g., getSuffixPatternsFieldNames).

Current Code Snippet (getLinkActions):

PHP

public function getLinkActions($pubObject) {
    $linkActions = array();
    $request = PKPApplication::get()->getRequest();
    $dispatcher = $request->getDispatcher();
    $userVars = array('pubIdPlugIn' => 'ARKPubIdPlugin');

    // Logic to define $handler based on $pubObject...

    $linkActions['clearPubIdLinkActionARK'] = new LinkAction(
        'clearPubId',
        new RemoteActionConfirmationModal(
            $request->getSession(),
            __('plugins.pubIds.ark.editor.clearObjectsARK.confirm'),
            __('common.delete'),
            $dispatcher->url($request, PKPApplication::ROUTE_COMPONENT, null, $handler, 'clearPubId', null, $userVars),
            'modal_delete'
        ),
        __('plugins.pubIds.ark.editor.clearObjectsARK'),
        'delete'
    );
    return $linkActions;
}

Could someone point me to a reference implementation or documentation on how the PubId clearing workflow has changed for 3.4?

I using: OJS 3.4.0-10

Thanks in advance for your help!

Hi @laaimar,

At a glance, you’re being directed to the wrong handler because of the 3rd parameter in Dispatcher::url. If it’s null, it’ll try to detect the right handler based on the current request. If you want to use another handler, specify it by name instead.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

First of all, thank you very much for your previous response. That helped a lot!

I will continue working on updating the plugin. Now I’m having trouble registering custom Grid Handlers for the plugins.

Thanks again. Greetings.

1 Like

This topic was automatically closed after 13 days. New replies are no longer allowed.