nystudio107 / craft-seomatic

SEOmatic facilitates modern SEO best practices & implementation for Craft CMS 3. It is a turnkey SEO system that is comprehensive, powerful, and flexible.
https://nystudio107.com/plugins/seomatic
Other
162 stars 68 forks source link

Truncate settings not working as expected #1386

Closed biteMedia closed 7 months ago

biteMedia commented 7 months ago

Describe the bug

The 'Truncate Description Tags' switch on the Plugin Settings > Titles page seems to have no effect on truncating meta description content. The 'Truncate Title Tags' setting when switched on though, seems to truncate both meta title and description content.

To reproduce

  1. Go to the SEOmatic Plugin Settings page > Titles tab
  2. Turn off the 'Truncate Title Tags', turn on the 'Truncate Description Tags' switch and save the settings
  3. Open an entry with an SEO Settings field
  4. Override both the 'SEO Title Source' and 'SEO Description Source' settings and enter text into both which is longer than their respective maximums
  5. Load the entry's URL in another tab and view the page source - the meta description content in my tests is not truncated
  6. Go back to the SEOmatic Plugin Settings page > Titles tab and reverse the switches: turn on 'Truncate Title Tags' and turn off 'Truncate Description Tags' and save the settings
  7. Reload the entry's page source - both meta title and description content are truncated in my tests

Expected behaviour

'Truncate Title Tags' switch controls title meta content and 'Truncate Description Tags' controls description meta content. Not sure if there's something I'm doing in certain templates that's causing this - I am using seomatic.jsonLd.create() to replace the BreadcrumbList on some pages but removing that has no effect.

Versions

khalwat commented 7 months ago

Wow, this one surprised me! Nice catch!

Addressed in https://github.com/nystudio107/craft-seomatic/commit/e5e102e4091e9bb8a6ce2419757be39bf098a9b0 & https://github.com/nystudio107/craft-seomatic/commit/1368b68bcc060c576d5b6615e43cbbd8e00957fc

Craft CMS 3:

You can try it now by setting your semver in your composer.json to look like this:

    "nystudio107/craft-seomatic": "dev-develop as 3.4.67”,

Then do a composer clear-cache && composer update

…..

Craft CMS 4:

You can try it now by setting your semver in your composer.json to look like this:

    "nystudio107/craft-seomatic": "dev-develop-v4 as 4.0.36”,

Then do a composer clear-cache && composer update

biteMedia commented 7 months ago

Thanks! Working perfectly now.