Overall score indicator does not show color

Created on 19 August 2019, almost 6 years ago
Updated 22 September 2023, almost 2 years ago

In 2.x version of this module the overall score indicator does not show the different colors for good, bad and okay as would be expected. Instead the indicator always stays grey regardless of current overall score. although the label of the overall status is fine and shows the current overall score.

See this screenshot for reference:

This is resulting from taking the overall status label as is for the css class that is used for coloring the indicator. I would propose to use clean_class on this. In addition there is also a difference between the label "Okay" and the css class "ok" (maybe this is something that is originating from the 1.x version), I would propose to adjust this too.

I will provide a patch for this.

🐛 Bug report
Status

Fixed

Version

2.0

Component

User interface

Created by

🇩🇪Germany stefan.korn Jossgrund

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇩🇪Germany EnnoKirchhoff

    We have tested with version 8.x-2.x-alpha8 and updated the patch with a minor bugfix in JS which adds the class of the score indication while saving the seo form.

    --- a/js/yoast_seo.js
    +++ b/js/yoast_seo.js
    @@ -292,6 +292,8 @@
           rating = ( score / 10 );
         }
    
    document.getElementById(this.config.targets.overall_score).className= "overallScore";
    document.getElementById(this.config.targets.overall_score).classList.add(this.scoreToRating(rating).toLowerCase()); document.getElementById(this.config.targets.overall_score).getElementsByClassName('score_value')[0].innerHTML = this.scoreToRating(rating); document.querySelector('[data-drupal-selector="' + this.config.fields.seo_status + '"]').setAttribute('value', rating); };
  • Status changed to RTBC almost 2 years ago
  • 🇧🇪Belgium BramDriesen Belgium 🇧🇪

    Tested this on the alpha9 release and confirm that the patch fixed the issue.

    Linked my duplicate issue as well and attached a screenshot showing the patch does what it promises.

  • Status changed to Fixed almost 2 years ago
  • 🇳🇱Netherlands kingdutch

    In 2.x version of this module the overall score indicator does not show the different colors for good, bad and okay as would be expected. Instead the indicator always stays grey regardless of current overall score. although the label of the overall status is fine and shows the current overall score.

    See this screenshot for reference:

    This is resulting from taking the overall status label as is for the css class that is used for coloring the indicator. I would propose to use clean_class on this. In addition there is also a difference between the label "Okay" and the css class "ok" (maybe this is something that is originating from the 1.x version), I would propose to adjust this too.

    I will provide a patch for this.

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

Production build 0.71.5 2024