Unable to Set ISBN - The publication format is not assigned to authorized submission

Hello All,

Since about 10 days I am facing issues with publishing any monograph.

When editing Metadata of a “Publication Format” → Edit, I see “Loading” messages four times:
image

When I checked the developer tool and inspected the network calls, I found four calls returning “The publication format is not assigned to authorized submission!”.
The URLs for which it returns this are:

  • /index.php/kdp/$$$call$$$/grid/catalog-entry/identification-code-grid/fetch-grid?submissionId=60&publicationId=61&representationId=157&_=1625
  • /index.php/kdp/$$$call$$$/grid/catalog-entry/sales-rights-grid/fetch-grid?submissionId=60&publicationId=61&representationId=157&_=1626
  • /index.php/kdp/$$$call$$$/grid/catalog-entry/markets-grid/fetch-grid?submissionId=60&publicationId=61&representationId=157&_=1627
  • /index.php/kdp/$$$call$$$/grid/catalog-entry/publication-date-grid/fetch-grid?submissionId=60&publicationId=61&representationId=157&_=1628

I also noticed that I am getting HTTP500 error for following calls:
Manage Catalog - /index.php/kdp/manageCatalog
Delete Publication Format File - /index.php/kdp/$$$call$$$/api/file/manage-file-api/delete-file?submissionFileId=1469&submissionId=60&stageId=5

This is preventing me from publishing the monograph with correct ISBN.

Has anybody else faced similar issue? How did you resolve or fix it?
Please point me to the right documentation/article or reference.

Thanks and Regards.

Hi @kdpadmin,

Are you able to provide your specific OMP version number (e.g. 3.3.0-8), and also are you able to check your PHP error logs for any relevant messages there - those tend to be more helpful for issues like this.

-Roger
PKP Team

Hi Roger,

I am using OMP version 3.3.0.8.
PHP error logs show following when I navigate to Publication Format → Edit → Metadata

[11-Jul-2022 17:51:34 UTC] omp: The publication format is not assigned to authorized submission!
[11-Jul-2022 17:51:34 UTC] omp: The publication format is not assigned to authorized submission!
[11-Jul-2022 17:51:34 UTC] omp: The publication format is not assigned to authorized submission!
[11-Jul-2022 17:51:34 UTC] omp: The publication format is not assigned to authorized submission!

Interesting … not sure about this one, but I’ll see if some of my colleagues can weigh in when they’re available.

-Roger
PKP Team

Sure Roger!

just to add, I have intermittent errors in the logs much before this issue started. This issue started around 8th July.
Not sure if this helps, I thought it might help.

Hi Roger,

Any inputs from your colleagues?
I am unable to publish monographs as I cannot set the ISBN anymore.

Thanks in advance!

I observed that I get following in error log when I navigate to Submissions → All Active → View for the monograph I am publishing.
[13-Jul-2022 06:15:23 UTC] omp: Representative referenced outside of authorized monograph context!

Error log is attached for reference.

[13-Jul-2022 05:25:26 UTC] omp: 404 Not Found
[13-Jul-2022 06:04:39 UTC] omp: Representative referenced outside of authorized monograph context!
[13-Jul-2022 06:04:49 UTC] omp: The publication format is not assigned to authorized submission!
[13-Jul-2022 06:04:49 UTC] omp: The publication format is not assigned to authorized submission!
[13-Jul-2022 06:04:49 UTC] omp: The publication format is not assigned to authorized submission!
[13-Jul-2022 06:04:49 UTC] omp: The publication format is not assigned to authorized submission!
[13-Jul-2022 06:04:58 UTC] PHP Warning:  Undefined array key 1 in /home4/myhome/my.website/pages/manageCatalog/ManageCatalogHandler.inc.php on line 77
[13-Jul-2022 06:04:58 UTC] PHP Fatal error:  Unparenthesized `a ? b : c ? d : e` is not supported. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)` in /home4/myhome/my.website/classes/components/listPanels/CatalogListPanel.inc.php on line 76
[13-Jul-2022 06:05:02 UTC] omp: Representative referenced outside of authorized monograph context!
[13-Jul-2022 06:05:07 UTC] omp: Representative referenced outside of authorized monograph context!
[13-Jul-2022 06:05:48 UTC] omp: Representative referenced outside of authorized monograph context!
[13-Jul-2022 06:06:53 UTC] omp: Representative referenced outside of authorized monograph context!
[13-Jul-2022 06:07:09 UTC] PHP Warning:  Undefined array key "stageId" in /home4/myhome/my.website/lib/pkp/controllers/grid/eventLog/SubmissionEventLogGridHandler.inc.php on line 111
[13-Jul-2022 06:07:30 UTC] omp: Representative referenced outside of authorized monograph context!
[13-Jul-2022 06:07:35 UTC] omp: Representative referenced outside of authorized monograph context!
[13-Jul-2022 06:07:42 UTC] omp: The publication format is not assigned to authorized submission!
[13-Jul-2022 06:07:42 UTC] omp: The publication format is not assigned to authorized submission!
[13-Jul-2022 06:07:42 UTC] omp: The publication format is not assigned to authorized submission!
[13-Jul-2022 06:07:42 UTC] omp: The publication format is not assigned to authorized submission!
[13-Jul-2022 06:07:42 UTC] omp: The publication format is not assigned to authorized submission!
[13-Jul-2022 06:07:42 UTC] omp: The publication format is not assigned to authorized submission!
[13-Jul-2022 06:07:42 UTC] omp: The publication format is not assigned to authorized submission!
[13-Jul-2022 06:07:42 UTC] omp: The publication format is not assigned to authorized submission!
[13-Jul-2022 06:08:35 UTC] omp: The publication format is not assigned to authorized submission!
[13-Jul-2022 06:08:35 UTC] omp: The publication format is not assigned to authorized submission!
[13-Jul-2022 06:08:35 UTC] omp: The publication format is not assigned to authorized submission!
[13-Jul-2022 06:08:35 UTC] omp: The publication format is not assigned to authorized submission!
[13-Jul-2022 06:08:46 UTC] omp: Representative referenced outside of authorized monograph context!
[13-Jul-2022 06:08:59 UTC] PHP Warning:  Undefined array key "stageId" in /home4/myhome/my.website/lib/pkp/controllers/grid/eventLog/SubmissionEventLogGridHandler.inc.php on line 111
[13-Jul-2022 06:09:21 UTC] omp: Representative referenced outside of authorized monograph context!
[13-Jul-2022 06:09:27 UTC] PHP Fatal error:  Uncaught Exception: PublicationFormatMetadataForm was instantiated without required dependencies. in /home4/myhome/my.website/controllers/grid/catalogEntry/form/PublicationFormatMetadataForm.inc.php:62
Stack trace:
#0 /home4/myhome/my.website/controllers/grid/catalogEntry/PublicationFormatGridHandler.inc.php(584): PublicationFormatMetadataForm->__construct(Object(Submission), Object(Publication), NULL)
#1 /home4/myhome/my.website/lib/pkp/classes/core/PKPRouter.inc.php(395): PublicationFormatGridHandler->editFormatMetadata(Array, Object(Request))
#2 /home4/myhome/my.website/lib/pkp/classes/core/PKPComponentRouter.inc.php(257): PKPRouter->_authorizeInitializeAndCallRequest(Array, Object(Request), Array)
#3 /home4/myhome/my.website/lib/pkp/classes/core/Dispatcher.inc.php(144): PKPComponentRouter->route(Object(Request))
#4 /home4/myhome/my.website/lib/pkp/classes/core/PKPApplication.inc.php(362): Dispatcher->dispatch(Object(Request))
#5 /home4/myhome/my.website/index.php(64): PKPApplication->execute()
#6 {main}
  thrown in /home4/myhome/my.website/controllers/grid/catalogEntry/form/PublicationFormatMetadataForm.inc.php on line 62
[13-Jul-2022 06:09:32 UTC] PHP Fatal error:  Uncaught Exception: PublicationFormatMetadataForm was instantiated without required dependencies. in /home4/myhome/my.website/controllers/grid/catalogEntry/form/PublicationFormatMetadataForm.inc.php:62
Stack trace:
#0 /home4/myhome/my.website/controllers/grid/catalogEntry/PublicationFormatGridHandler.inc.php(584): PublicationFormatMetadataForm->__construct(Object(Submission), Object(Publication), NULL)
#1 /home4/myhome/my.website/lib/pkp/classes/core/PKPRouter.inc.php(395): PublicationFormatGridHandler->editFormatMetadata(Array, Object(Request))
#2 /home4/myhome/my.website/lib/pkp/classes/core/PKPComponentRouter.inc.php(257): PKPRouter->_authorizeInitializeAndCallRequest(Array, Object(Request), Array)
#3 /home4/myhome/my.website/lib/pkp/classes/core/Dispatcher.inc.php(144): PKPComponentRouter->route(Object(Request))
#4 /home4/myhome/my.website/lib/pkp/classes/core/PKPApplication.inc.php(362): Dispatcher->dispatch(Object(Request))
#5 /home4/myhome/my.website/index.php(64): PKPApplication->execute()
#6 {main}
  thrown in /home4/myhome/my.website/controllers/grid/catalogEntry/form/PublicationFormatMetadataForm.inc.php on line 62

Hi Roger,

I digged into the code a little bit. I checked the file controllers/grid/catalogEntry/IdentificationCodeGridHandler.inc.php.

Specifically the following piece of code:

    function initialize($request, $args = null) {
        parent::initialize($request, $args);

        // Retrieve the authorized submission.
        $this->setSubmission($this->getAuthorizedContextObject(ASSOC_TYPE_SUBMISSION));
        $this->setPublication($this->getAuthorizedContextObject(ASSOC_TYPE_PUBLICATION));
        $publicationFormatDao = DAORegistry::getDAO('PublicationFormatDAO'); /* @var $publicationFormatDao PublicationFormatDAO */
        $representationId = null;

        // Retrieve the associated publication format for this grid.
        $identificationCodeId = (int) $request->getUserVar('identificationCodeId'); // set if editing or deleting a code

        if ($identificationCodeId != '') {
            $identificationCodeDao = DAORegistry::getDAO('IdentificationCodeDAO'); /* @var $identificationCodeDao IdentificationCodeDAO */
            $identificationCode = $identificationCodeDao->getById($identificationCodeId, $this->getPublication()->getId());
            if ($identificationCode) {
                $representationId = $identificationCode->getPublicationFormatId();
            }
        } else { // empty form for new Code
            $representationId = (int) $request->getUserVar('representationId');
        }

The code after this piece is dependent on representationId to get publicationFormat.

The Problem:
Somehow, the identificationCodeId from request is coming in as ‘0’ (number zero). Even from the database the identificationCode is not available for identificationCode 0. Once the control is inside the following if block, it cannot use the representationId from request.

if ($identificationCodeId != '')

The Fix?
I modified the code and added an else to the following if condition and set the representationId variable to the value coming in from request.

if ($identificationCode)

Modified Code looks like below:

    function initialize($request, $args = null) {
        parent::initialize($request, $args);

        // Retrieve the authorized submission.
        $this->setSubmission($this->getAuthorizedContextObject(ASSOC_TYPE_SUBMISSION));
        $this->setPublication($this->getAuthorizedContextObject(ASSOC_TYPE_PUBLICATION));
        $publicationFormatDao = DAORegistry::getDAO('PublicationFormatDAO'); /* @var $publicationFormatDao PublicationFormatDAO */
        $representationId = null;

        // Retrieve the associated publication format for this grid.
        $identificationCodeId = (int) $request->getUserVar('identificationCodeId'); // set if editing or deleting a code

        if ($identificationCodeId != '') {
            error_log("ByKDPAdmin identificationCode is ".$identificationCodeId);
            $identificationCodeDao = DAORegistry::getDAO('IdentificationCodeDAO'); /* @var $identificationCodeDao IdentificationCodeDAO */
            $identificationCode = $identificationCodeDao->getById($identificationCodeId, $this->getPublication()->getId());
            error_log("ByKDPAdmin identificationCode from DAO is ".$identificationCodeId);
            if ($identificationCode) {
                error_log("ByKDPAdmin RepresentationId is based on identifationCode");
                $representationId = $identificationCode->getPublicationFormatId();
            }
            else{
                error_log("ByKDPAdmin RepresentationId is based on representationid from request");
                $representationId = (int) $request->getUserVar('representationId');
            }
        } else { // empty form for new Code
            error_log("ByKDPAdmin representation id is based on uservar representationId");
            $representationId = (int) $request->getUserVar('representationId');
        }

        // By KDPAdmin
        error_log("ByKDPAdmin RepresentationId Is ".$representationId." . and publication id is ".$this->getPublication()->getId());

        $publicationFormat = $publicationFormatDao->getById($representationId, $this->getPublication()->getId());

        if ($publicationFormat) {
            $this->setPublicationFormat($publicationFormat);
        } else {
            fatalError('The publication format is not assigned to authorized submission!');
        }

With this change I am able to see the Identification Code UI. Other 3 “Loading” errors are still there.
image

I have not yet tried to set the ISBN in Product Identification so I dont know if this will work and set the ISBN or not.
I have tested and I am able to set the ISBN. :+1:

But I have a few questions:

  1. Should I make similar change to other files also?
  2. Is this the correct fix?
  3. Why is this behavior out of the blue? it was working fine till about 8th July.

Hi @kdpadmin,

Sorry - but you’ll have to be patient in waiting for a response. We are a small team and need to balance our time spent answering questions here on the Forum with our other work developing and maintaining our free and open source software and other services. We try our best but do not guarantee that every question will be answered or that every issue is resolved.

Thank you for the additional log information - that will be helpful.

-Roger
PKP Team

Hi Roger,

Please check the below change I made to the code to fix it. I was able to get around the issue of not having an option to set the ISBN in Publication Format Metadata.

It would be great if you could get this change verified.

Hi @kdpadmin ,

I’m facing the same issue on my test server where PHP 8.1 is installed.
It does not occur when I use php 7.
Maybe it has something to do with that too?
Regards