pkp / pkp-lib

The library used by PKP's applications OJS, OMP and OPS, open source software for scholarly publishing.
https://pkp.sfu.ca
GNU General Public License v3.0
307 stars 447 forks source link

Long publication title stops submit/review process #10020

Closed temin closed 5 months ago

temin commented 5 months ago

Describe the bug When an author submits a new article with a very long title (~170+ characters) or reviewer accepts a review of such article, the user interface hangs and the cogwheel just keeps on turning. User can continue only after page reload.

To Reproduce Steps to reproduce the behavior (author):

  1. As an author add a new article to journal
  2. On the final step click 'Submit' button
  3. Cogwheel next to 'Submit' button never stops turning
  4. Reload page (F5) to see your submission

Steps to reproduce the behavior (reviewer):

  1. Click the article link in 'Invitation to review' email
  2. Click Accept Review, Continue to Step #2 button
  3. Cogwheel next to button never stops turning
  4. Reload page (F5) to see the rest of review process

What application are you using? OJS 3.4.0-5

Additional information In the background, article is submitted or review accepted. Emails are sent, but not saved in 'email_log' table. There is a PHP error logged:

AH01071: Got error 'PHP message: PHP Fatal error: Uncaught PDOException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'subject' at row 1 in ...

The 'subject' column in 'email_logs' table is of type 'VARCHAR(255)'.

We fixed the problem by increasing the VARCHAR length in OJS database. Another 'no coding' workaround could be to change the email templates in 'ojs/lib/pkp/locale/en/emails.po':

msgid "emails.reviewComplete.subject" msgstr "Review complete: {$reviewerName} recommends {$reviewRecommendation} for #{$submissionId} {$authorsShort} — {$submissionTitle}"

msgid "emails.submissionNeedsEditor.subject" msgstr "A new submission needs an editor to be assigned: {$submissionTitle}"

jonasraoni commented 5 months ago

Related https://github.com/pkp/pkp-lib/issues/9988

taslangraham commented 5 months ago

@asmecher I've created a PR for this. PRs

Description: Emails with subject lines exceeding 255 characters will be truncated when saved to the database. An example of a truncated subject line would be Review accepted: Julie Janssen accepted review assignment for #31 Mwandenga — Exploring the Impact of Climate Variability on Photosynthetic Efficiency and Adaptive Mechanisms in Diverse Plant Species: Insights into Resilience and Sustainability in Ch... An ellipsis is appended at the end to indicate truncation.

asmecher commented 5 months ago

Thanks, @taslangraham, I've reviewed this: https://github.com/pkp/pkp-lib/pull/10100#pullrequestreview-2129112841

taslangraham commented 5 months ago

@asmecher I've made the requested changes and created a PR to forward port to main. PR - https://github.com/pkp/pkp-lib/pull/10104

asmecher commented 5 months ago

Thanks, @taslangraham, I've merged both!