I got the following message:

The website encountered an unexpected error. Please try again later.InvalidArgumentException: $string ("Read time: :read_time") must be a string. in Drupal\Core\StringTranslation\TranslatableMarkup->__construct() (line 132 of core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php).

Thank you.

CommentFileSizeAuthor
#2 string_error-3068116-2.patch436 bytessergiu stici

Comments

s-jack created an issue. See original summary.

sergiu stici’s picture

Status: Active » Needs review
StatusFileSize
new436 bytes

Here is the patch, please review.

patelmayank7552’s picture

Assigned: Unassigned » patelmayank7552
patelmayank7552’s picture

Status: Needs review » Reviewed & tested by the community

Hi @s-jack,

I have applied the patch in the module and it's working fine.

Thanks.

mmjvb’s picture

Assigned: patelmayank7552 » Unassigned

@patelmayank7552 Please refrain from assigning to yourself when reviewing. Only assign to yourself when planning to provide a solution.

s-jack’s picture

Hi patelmayank7552.

I am sorry for my late response.
Thank you for creating a patch file.

I did the following and got the message.

patch --dry-run -p1 < string_error-3068116-2.patch
patch: **** Only garbage was found in the patch input.

How can I apply the patch?

mmjvb’s picture

Make sure you are in the folder of read_time. Then issue: patch < string_error-3068116-2.patch
This assumes you moved the patch into the read_time folder.

s-jack’s picture

Thank you, mmjvb and everyone.

I successed to apply patching.
Patch seems to work well for me.

a3hill’s picture

Patched successful for me.

valthebald’s picture

zanvidmar’s picture

Patch successfully applied. Thank you.

jplana’s picture

Patch solved the error for me. Thank you.

dqd’s picture

Status: Reviewed & tested by the community » Closed (duplicate)
Related issues: +#3051696: Wrong behaviour when no Read time is saved for current node

Exchanged closed/duplicate state of both related issues respecting the D.O. recommendation to close the newer regarding the older one, but I am still not convinced yet that these 2 issues are duplicates. Please review this again. But apart from that the older one has better title, description and more different patch approaches than this one here anyways.

BTW: https://www.drupal.org/files/issues/2019-07-08/3051696-5.patch is exactly the same patch than the one provided here.

joco_sp’s picture

As per the comment above the solution from the issue #3051696 was applied, because it was created first and the patches there solve 2 issues.
Thank you for the help. I credited all of you on the other issue. If you'll still have this error, please re-open it.
The fix will be available in the new version.