We have just detected some problems with the Books For Review plug-in. We can neither use the ‘assign’ or ‘request for review’. It is inactive. We’re running the 126.96.36.199 edition of OJS.
Have you any suggestions how to solve that problem?
Hmmm… This sounds strange… I have the same version but cannot reproduce your problem. What do you mean with ‘inactive’?
I have set up a test journal, just to start at the very beginning. I’ve made the settings and created two “books for review” (se below). What shall I do next?
Hi Niels Erik,
Hmmm… In your screenshot the both books seem to be already reviewed i.e. an article (the review) is submitted – they are in the queue “submitted”. Actually, that’s it i.e. this is the end of the process here – the article goes then, as any other article, through the whole publishing process (review, copy editing, layout…).
In book for review plugin you can create books, present them to the users, an author can signal the wish to review a book and the editor can assign an author to a book. The physical book can be mailed to the author and this can be marked in the system. And then the author should submit the article (the actual review of the book). When submitting, he/she can notify/define which book the article is a review of.
Sorry, I must have made a mistake, but now I have one available:
If I go to ‘Books for review’ nothing happens when I click the link ‘Request this book for review’
Yes, that’s correct.
– an author will see the link “request this book for review” and can click on it and ‘reserve’ the book. The editor then decides if this author should review this book.
– the editor already knows who should review this book (e.g. they communicated via e-mail) and can immediately assign the author using the ‘assign’ link.
But the problem is that nothing happens when I, as an author, click the ‘REQUEST THIS BOOK FOR REVIEW’
Hmmm… An e-mail form i.e. the e-mail template BFR_BOOK_REQUESTED should be displayed next. Do you have this e-mail template in your list?
What happens for you, when you click on the link, just nothing?
Hmmm… Maybe an error occurs – could you maybe see in the apache error log file if there is an entry when you click on the link?
I investigated this on behalf of nef since he does not have server side access, there are no errors reported.
In the access log I see that both ‘viewBookForReview’ and ‘requestBookForReview’ are getting a 302 back to the ‘booksForReview’ overview.
In normal circumstances we have a number of rewrites done on the apache side and a number of base_url settings as well. They were all disabled in my testing so it looks to me like the 302 is coming from OJS itself.
Hmmm… Strange, strange…
In the code there is a redirect to that page if some conditions are not met/true. I believe it could maybe be
this condition, because it is in those both functions you mentioned:
$bfrDao->getBookForReviewJournalId($bookId) == $journalId
It looks like the journal ID of the book is not the same with the one gotten from the request.
Maybe it has something to do with those redirects that you made. Did you removed/commented out also the base URL override settings from the config.inc.php (e.g. base_url[index], base_url[myJournal])?
Yes, all base_url settings are commented and inactive and I enabled mod_rewrite logging so I am sure that no rewrites are being done on the apache side.
Looking in the database does not seem to reveal any inconsistency:
ojs-devel=# select journal_id from journals where path = 'test'; journal_id ------------ 143 (1 row) ojs-devel=# select journal_id,book_id from books_for_review where journal_id = 143; journal_id | book_id ------------+--------- 143 | 195 143 | 196 143 | 198 143 | 199 (4 rows) ojs-devel=#
book_id 198 is the one that nef was testing with (“Make a test”) and 199 is one that I created. Both exhibit this issue.
I instrumented viewBookForReview() and traced the execution.
It passes the journalid == bookid check and it also passes the next getStatus() = BFR_STATUS_AVAILABLE check.
But afterwards is executes the redirect anyway, since it is not guarded by an else condition on the first if (the journalid==bookid check).
If I make the redirect conditional via else I get the detailed view I was expecting.
The same thing happens in requestBookForReview(), adding an else gives me the expected form with the prepared email.
I created a pull request with the changes I made:
Thanks for contributing, @tgc99!
Public Knowledge Project Team