getgrav / grav-premium-issues

Official Grav Premium Issues repository to report problems or ask questions regarding the Premium products offered.
https://getgrav.org/premium
7 stars 2 forks source link

[seo-magic] Crash: Undefined variable: summary #262

Closed aleclerc7 closed 2 years ago

aleclerc7 commented 2 years ago

Hello,

SEO summary description:

In the Admin, if opening a page where none of the "Header Attributes" are found, there is a crash in SEOMagic.php line 364 "Undefined variable: summary." (Also makes the same crash on the website when trying to open the page.)

image

Kind regards.

PS. A fallback mechanism, like for images, would have been nice for the summaries.

rhukster commented 2 years ago

link 327 add:

$summary = '';
rhukster commented 2 years ago

BTW, i think in terms of summary it will be confusing to fall back to other approaches. Better to display empty so that you realize your attributes are not working as intended. If it fell back to something else transparently, you might not realize why the summary was the way it was if you were expecting something else.

aleclerc7 commented 2 years ago

Thank you! It works. 👍

For the no-fallback, I understand what you say.

Maybe a special attribute name to tell SEO Magic to pick up its calculated summary? Like hero.content, [seo-magic]? :-) So it would be a purposeful opt-in for this behaviour. When the auto-summary becomes very good, the header attributes will (could) become overrides when needed. (I was seeing the attributes more as overrides, not as a fully independent system in itself. The attributes would be the primary source, then the automatic stuff, then the manual per-page overrides if needed.)

Kind regards.