The vote summary now reads

With single vote:

{{ results.vote_field_count }} vote with a rating of {{ results.vote_field_average }}

With multiple votes:

{{ results.vote_field_count }} votes with an average rating of {{ results.vote_field_average }}.

Comments

ShaunDychko created an issue. See original summary.

shaundychko’s picture

Status: Active » Needs review
StatusFileSize
new1.71 KB
tr’s picture

I'm in favor of doing this, but can it be done without introducing excessive whitespace and indentation in the rendered markup?

tr’s picture

I think votingapi-widgets-summary--like.html.twig also needs to be fixed?

loze’s picture

Status: Needs review » Closed (duplicate)
Related issues: +#3024324: Twig templates for like and useful widget summaries are not being rendered

I have a patch that fixes this as well as the issue of the 'useful' and 'like' templates not being rendered here #3024324: Twig templates for like and useful widget summaries are not being rendered

I'm going to close this in favor of that one, since there is a more complete patch there.

tr’s picture

Status: Closed (duplicate) » Needs review

No, let's fix the pluralization here - the template suggestion issue in #3024324: Twig templates for like and useful widget summaries are not being rendered is unrelated and should be handled separately.

Please contribute towards improving the patch in #2.

loze’s picture

StatusFileSize
new2.87 KB

Here you go.

Status: Needs review » Needs work

The last submitted patch, 7: votingapi_widgets-plural-3171180-7.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

tr’s picture

Status: Needs work » Needs review
StatusFileSize
new2.89 KB
new1.29 KB

Now that #3173374: Update composer.json has been committed we should no longer see "Composer require failure" so I retested the patch. As you can see, it shows "Build successful" but it also shows 8 new coding standards violations introduced by the patch.

Here's a re-roll of the patch to fix those coding standards.

Note that the testbot will still automatically mark this as "Needs work" because there are no actual tests yet, but if you examine the test output you should see that the coding standards violations have gone away.

EDIT: I accidentally named the interdiff with a .patch extension (should have been .txt) so I aborted the test on that file - it was never meant to be tested.

The last submitted patch, 9: 3171180-9-pluralization.patch, failed testing. View results

tr’s picture

Status: Needs review » Fixed

Committed #9.

  • TR committed e0550dd on 8.x-1.x
    Issue #3171180 by TR, loze, ShaunDychko: Write vote summary with correct...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.