OMP don't show feature and new release books in homepage

Hello, I’m using OMP 3.1.2-1.with Debian10, PHP7.2 and MariaDB.
OMP don’t show Feature Book and New Releases in frontpage. I have this error from Apache Log:

[php7:warn] [pid 18605] [client xxxxx:57395] PHP Warning: Declaration of PublicationFormatCategoryGridDataProvider::loadData($request, $filter = NULL) should be compatible with SubmissionFilesCategoryGridDataProvider::loadData() in /web/htdocs/libros/controllers/grid/catalogEntry/PublicationFormatCategoryGridDataProvider.inc.php on line 19, referer: http://libros.uanl.mx/index.php/catalogo/workflow/index/1/5


PHP Warning: Declaration of SubmissionSubjectEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL) should be compatible with ControlledVocabEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL, $filter = NULL) in /web/htdocs/libros/lib/pkp/classes/submission/SubmissionSubjectEntryDAO.inc.php on line 20, referer: http://libros.uanl.mx/index.php/catalogo/catalog

I have another OMP installation, on another server and if it shows the books in frontpage.
Any ideas?

Hi @asmecher,

I have the same problem, OMP 3.1.2-1 and I think I found a root cause of it.

I have investigated only ‘New Release’ problem. I have 2 presses on my installation, with the IDs 3 and 4. I looked in the DB table ‘new_releases’. If I mark a book in the UI as a new release the entry in the DB gets assoc_id set to 1. I figured out that it should be either 3 or 4, depending on the press I am working in. If I manually change this wrong 1 to 3 (or 4), then the book is presented on the first page under new books.

So I believe something is wrong with the part of the UI that stores this new release info - instead of storing press ID it stores always 1. In case of having only 1 press installed that even works, so maybe that is why it has not been discovered in your test environment.

@asmecher can you please look at this or forward the problem to someone else, I believe the fix must be quite simple and fast. And I really need it :slight_smile:

Best regards, Primož

Hi @primozs,

See OMP 3.1.2 New releases and featured not visible in front page · Issue #4578 · pkp/pkp-lib · GitHub – there’s a comment at the end describing the necessary commits to back-port the fix.

Regards,
Alec Smecher
Public Knowledge Project Team

2 Likes

Hi @asmecher,

Great, that was the issue I expected, the contextID (that changed in recent version, I think).

The fix is clear to me, however I have one issue: I don’t have SSH access to the server to rebuild the vue.js code. Is there any other way to fix it?

Best regards, Primož

Hi @primozs,

I expect to release OJS/OMP 3.1.2-2 very shortly with the fix included – I’d suggest hanging on for that!

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

I got some help and managed to get new buid of the js code and added a line of code in the file controllers/list/submissions/CatalogSubmissionsListHandler.inc.php

but it doesn’t work :frowning: I cleaned the template cashes, just in case and it doesn’t help. Tried with incognito mode also. The DB table ‘new_releases’ still contains wrong context (assoc_id).

Any idea what can be wrong?

Best regards, Primož

Hi @primozs,

Did you rebuild the Javascript? That’ll be necessary (e.g. npm run build).

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

Yes. And I replaced the js directory with all the contect on the installation.

Best regards, Primož

Hi @primozs,

If you work with the catalog listings, e.g. un-featuring and re-featuring these submissions, does the context_id get corrected?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

Unfortunately not. I did some debugging:

Selecting/deselecitng new feature in the catalog page enters/deletes an entry in the DB, but assoc_id is 1 instead of 4 - this is the context_id, right?

I changed the code in the controllers/list/submissions/CatalogSubmissionsListHandler.inc.php to folowing (lines 90+):

file_put_contents(“/public_html/controllers/list/submissions/logPrimoz”, PHP_EOL . "contextId? " . PHP_EOL, FILE_APPEND);

    if ($context) {
        $config['contextId'] = 4;

file_put_contents(“/public_html/controllers/list/submissions/logPrimoz”, PHP_EOL . "contextId: " . $context->getId().PHP_EOL, FILE_APPEND);

and still the DB gets 1 instead of 4, that I hardcoded, while nothing written in the logPrimoz

Further more, this is what I see in the browser console:

{“featured”:,“newRelease”:[{“assoc_type”:512,“assoc_id”:1}]}

Any idea what I am doing wrong? To me looks strange as I hardcoded 4 and still gets 1 to the DB. Wrong place?

Best regards, Primož

Hi @asmecher,

I have installed the fixed OMP 3.1.2-2 and I believe there is still an issue. Now I am able to select new releases in the catalog and get them presented on the first page, but the problem is that the book check boxes in the catalog list are not selected. When I select a check box, for a moment a check mark appears but immediately disappears. So you can see form the list which books are selected and which not.

Best regards, Primož

Hi @primozs,

Thanks for the heads up – I’ve replicated the behavior you see and tracked the problem down. It’s filed in Feature and Release checkboxes not sticking · Issue #5333 · pkp/pkp-lib · GitHub along with a patch. However, for the patch to be applied, you’ll also have to recompile the Vue templates using (in the OJS installation directory):

npm run build

You’ll need the Node/NPM toolset to do this. I’ll release a new OMP build with the fix included, and it’ll include the Javascript already compiled.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

Great, thank you. If I understnad correctly I can take only js subdirectory from the new release and copy it to my version, right? The fix is in that directory, right?

Best regards, Primož

Hi @primozs,

Yes, I believe so.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

Hi @asmecher,

Thank you very much. I just replaced the js directory and now it works.

Best regards, Primož

1 Like