-
Notifications
You must be signed in to change notification settings - Fork 334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NEW Include version number in meta generator tag #2721
NEW Include version number in meta generator tag #2721
Conversation
3146d24
to
f8bc302
Compare
5dcdd8a
to
f228bc8
Compare
f228bc8
to
58a2dfb
Compare
* @config | ||
* @var bool | ||
*/ | ||
private static $show_meta_generator_version = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just keep tho old behavior and not output the meta tag if `meta_generator' is blank?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That behavior is still there, if you config private static $meta_generator
to a blank string then there won't be a meta tag for generator
i.e.
public function MetaComponents()
...
$generator = $this->getGenerator();
if ($generator) {
$tags['generator'] = [
...
}
private function getGenerator(): string
{
$generator = trim(Config::inst()->get(self::class, 'meta_generator'));
if ($generator === '') {
return '';
}
if (self::config()->get('show_meta_generator_version')) {
...
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just don't understand what kind of user would say "I don't want the version number there, but I'm fine advertising the site uses Silverstripe CMS".
My gut feeling is the vast majority of users who are bothered by the version number will want to remove the entire meta tag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably very few users. However private static $meta_generator = 'Silverstripe CMS';
is currently a configurable string, so we do support changing this to something else e.g. 'CMS from Mars'.
If people want to report this as a different CMS for whatever reason, then I can see why they wouldn't want to include the version number
I'm not hugely attached to having these two things separately configurable, though I also don't see it as much extra hassle
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry ... meant to reject.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested it locally and it works fine. I hacked my composer.lock
file to test that the version is being picked up properly.
There's the slight question about what to do with "4.x-dev". Since this doesn't match the expected regex format, it just comes back with nothing. The help menu in the CMS renders "4.x".
The behaviour in this PR is pretty defensible and I don't have any beef with it. Just think it's worth pointing out this is happening.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, the composer file needs to be updated to require framework ^4.11
since we rely on the new API being present.
That was intentional, some people will be running forks of framework, don't want those being reported. I'll add an inline note about this composer.json has the ^4.11 requirement |
58a2dfb
to
27718ec
Compare
Framework PR has been merged which should make this PR green. Just restarted the build |
Issue #2708
Will require this PR to be merged first