60460[FEATURE] Add possibility to disable rendering of hreflang tag
Commit message
Review
-
Code review CR 0
-
Verified V 0
Issues 1
Files 5
- typo3/sysext/core/Documentation/Changelog/master/Feature-88140-PossibilityToDisableRenderingHreflangTags.rstnew+24 −0
- typo3/sysext/seo/Classes/HrefLang/HrefLangGenerator.php2+4 −1
- typo3/sysext/seo/Tests/Functional/Fixtures/HrefLang.typoscript+4 −0
- typo3/sysext/seo/Tests/Functional/Fixtures/NoHrefLang.typoscriptnew+17 −0
- typo3/sysext/seo/Tests/Functional/HrefLang/HrefLangGeneratorTest.php5+26 −6
Review log 2836
Show 711 earlier messages
-
Richard Haeser uploaded patch set 1 04/12/19, 20:33
-
Richard Haeser wrote 04/12/19, 20:33
Assignee added: Richard Haeser <richard@maxserv.com> -
TYPO3com voted on patch set 1 V -1 04/12/19, 20:47 Completed build in 14m 07s on Fri, 12 Apr, 10:47 PM Test Summary: 36 of 47736 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-33224
-
Richard Haeser uploaded patch set 2 04/13/19, 19:52
-
TYPO3com voted on patch set 2 V -1 04/13/19, 20:00 Completed build in 08m 10s on Sat, 13 Apr, 10:00 PM Test Summary: 39130 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-33244
-
Guido Schmechel commented on patch set 2 04/13/19, 20:06
HrefLangGeneratorTest.php:70Is the language ignored?HrefLangGeneratorTest.php:146UnresolvedTruncated?HrefLangGeneratorTest.php:154Truncated? -
Richard Haeser commented on patch set 2 04/14/19, 10:18
HrefLangGeneratorTest.php:70Reply UnresolvedAh. In this case, I can remove that language. Later on I will enhance these tests with language fallbacks etc. But that is out of scope for this patch. Will remove this language.HrefLangGeneratorTest.php:154Reply UnresolvedI don't want to see any hreflang tag so only checking on the first part so every hreflang tag will make this test fail. -
Richard Haeser uploaded patch set 3 04/14/19, 10:20
-
TYPO3com voted on patch set 3 V -1 04/14/19, 10:27 Completed build in 06m 07s on Sun, 14 Apr, 12:27 PM Test Summary: 39130 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-33248
-
Richard Haeser uploaded patch set 4 04/14/19, 10:59
-
TYPO3com voted on patch set 4 V +1 04/14/19, 11:10 Completed build in 10m 39s on Sun, 14 Apr, 01:10 PM Test Summary: 47427 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-33249
-
Richard Haeser uploaded patch set 5 04/14/19, 20:54
-
TYPO3com voted on patch set 5 V +1 04/14/19, 21:08 Completed build in 14m 05s on Sun, 14 Apr, 11:08 PM Test Summary: 47472 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-33264
-
Jörg Bösche voted on patch set 5 CR +1 04/15/19, 08:08
-
Chris Müller commented on patch set 5 04/16/19, 06:13
Patch Set 5: It works with "config.disableHrefLangTag" but not with "page.config.disableHrefLangTag". I think, this should be added. -
Guido Schmechel commented on patch set 5 04/16/19, 14:31
HrefLangGenerator.php:131$this->request There are maybe other positions? -
Richard Haeser commented on patch set 5 04/16/19, 14:59
HrefLangGenerator.php:131Reply UnresolvedGood catch. Will check it! -
Richard Haeser uploaded patch set 6 04/17/19, 06:45
-
TYPO3com voted on patch set 6 V +1 04/17/19, 06:59 Completed build in 13m 31s on Wed, 17 Apr, 08:59 AM Test Summary: 47484 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-33296
-
Guido Schmechel voted on patch set 6 V +1 CR +1 04/17/19, 20:03
-
Josef Glatz voted on patch set 6 V +1 CR +1 04/18/19, 13:35
-
Richard Haeser commented on patch set 6 CR -2 04/19/19, 07:50
Review of Benni needed -
Claus Due commented on patch set 6 04/19/19, 23:03
I would urge everyone writing features to avoid negative booleans, e.g. the "disable", "no" etc. prefixed naming. There's a plain reason why we don't like them: they encourage double negatives. For example, if you name the option "disableFoobar" then a check if "foobar" is enabled has to be done with checking "if not disable foobar" instead of the proper "if enable foobar". I realise we have hundreds if not thousands of cases of this in TYPO3 already but I'd really like to change the way we think about not just naming options but also the way they're implemented. If we keep these things in mind always, the result becomes much more consistent and predictable. Even if the default is to do X and the feature makes it possible to not do X, we should use a positive boolean and make the default value TRUE. -
Josef Glatz commented on patch set 6 V 0 CR 0 04/20/19, 06:14
@Claus: so you mean, if somebody wants to disable it he must write something like that: 1. config.enableHrefLangTag = 0 2. config.hrefLangTag.enable = 0 3. config.hrefLangTag = 0 4. config.head.tag.hreflang = 0 5. config.head.tag.hreflang.enable = 0 @Richard: beside that, what do you think about using "hreflang" and not "hrefLang" (lowerUpperCamelCase)? It's written lowercase in the official documentation (mozilla.org). -
Claus Due commented on patch set 6 04/20/19, 06:33
> Patch Set 6: -Verified -Code-Review > > @Claus: > > so you mean, if somebody wants to disable it he must write something like that: > > 1. config.enableHrefLangTag = 0 > 2. config.hrefLangTag.enable = 0 > 3. config.hrefLangTag = 0 > 4. config.head.tag.hreflang = 0 > 5. config.head.tag.hreflang.enable = 0 @Josef Only the first of these options fits. It is the one that is identifiable as a boolean option and isn't nested in a scope that would have only one option. 1. Is what I would use 2. Would make sense if there were other options aside from "enable" 3. Is not identifiable as boolean by name alone 4. Would make sense if there were other options for other tags in head that exist in the same scope, but is not identifiable as boolean by name alone 5. Combined case 2 and 4; would make sense if we had different premises e.g. more options in (each) scope -
Richard Haeser commented on patch set 6 04/20/19, 09:43
Hi Claus. Thanks for your comment. I introduced this negative because of 2 reasons: 1. The default is that hreflang tags are rendered. In the case you have a positive, it is necessary to have a default value because in my opinion it is unexpected behavior if something happens when there is an enable option and it’s not set, that it still renders the tags. 2. The other options in the config object I’m totally with you regarding positive booleans, but if we want to keep it consistent and predictable, we should do this for all options in the same object (in this case config). Too often integrators need the TSRef to check if it is enable or disable. So if we are ok with having default values and change multiple options within 1 version, I’m ok with that and in that case I’m really willing to help with that. (We have to think about an easy upgrade path). I think it is worth it, but we really should focus on integrators here instead of the developers is my opinion. So consistency and predictable options. -
Claus Due commented on patch set 6 04/20/19, 11:47
> Patch Set 6: > > Hi Claus. Thanks for your comment. I introduced this negative because of 2 reasons: > 1. The default is that hreflang tags are rendered. In the case you have a positive, it is necessary to have a default value because in my opinion it is unexpected behavior if something happens when there is an enable option and it’s not set, that it still renders the tags. I understand the logic but it is inverted. Default values of options can true or false and we can tweak each default value to the more prevalent use cases. I would prefer if they are all OFF by default (and shipped dist configurations toggles them on but you can opt not to use dist config). > 2. The other options in the config object > > I’m totally with you regarding positive booleans, but if we want to keep it consistent and predictable, we should do this for all options in the same object (in this case config). Too often integrators need the TSRef to check if it is enable or disable. That's the problem we want to think about in the future. If we do it with a negative boolean now there will be even more cases that prevent us from reaching the desired positive booleans. Context: I've identified two actual negative booleans in `config.` in addition to this new suggested one. Namely, `config.disablePrefixComment` and `config.disableLanguageHeader`. Both of those I would argue are very easily refactored to use a new set of positive booleans. One positive boolean exists: `config.typolinkEnableLinksAcrossDomains`. This one is actually correctly prefixed because it groups it with other `config.typolink*` options that exist and has `Enable` as a sub-prefix. History: There actually used to be a positive boolean setting (though it wasn't prefixed, surely to group it with other `typolink*` prefixed options). It has now been deprecated in v9. See config.typolinkCheckRootline. > So if we are ok with having default values and change multiple options within 1 version, I’m ok with that and in that case I’m really willing to help with that. (We have to think about an easy upgrade path). I'm very willing to change those things. Strategy below. > I think it is worth it, but we really should focus on integrators here instead of the developers is my opinion. So consistency and predictable options. I suggest that as a precursor task to this feature, we migrate those two options to become positive booleans, deprecate the current usages and in the end have three positive boolean options as the only type of boolean option inside `config.`. Support for the two current negative boolean options remains in v10 but is removed in v11. And then we write into our CGL and review expectations that naming of booleans in particular for public feature-toggling API should follow this positives-only pattern and should be clearly prefixed with `allow*`, `enable*`, `perform*` or similar positive verbs. Which one to use should be evident from code context. The thing is: every new positive boolean we might introduce to replace an old negative boolean will by nature have a different name. If we make the default *not* declared in for example TS but give it a default in code if NULL instead, it's excessively easy to null-coalesce our way to picking the right option based on what's in use, with higher priority for the new method. Wrap the "legacy" case of the null coalesce in a method that logs the deprecation and Bob's your uncle ;) -
Claus Due commented on patch set 6 04/20/19, 11:51
Forgot to mention one thing. There is no reason why we could not make the default value of a null-coalesced TS option, something you declare in for example TYPO3_CONF_VARS. This would mean we can begin to remove boilerplate TS and transparently make it possible to define anything you can define in `config.`, in the global PHP config for TYPO3, yet still be able to override it in TS per page branch etc. This is a much broader goal btw - removing the demand for TS to be written, making it easier to deploy such things / make them differ based on ENV. -
Richard Haeser commented on patch set 6 04/30/19, 19:07
As discussed with Benni. We will think about this option during the upcoming weeks. Will not be within the next patchlevel release. -
Jörg Bösche uploaded patch set 7 10/11/19, 12:37
-
TYPO3com voted on patch set 7 V -1 10/11/19, 12:51 Completed build in 13m 16s on Fri, 11 Oct, 12:51 PM Test Summary: 1 of 48347 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-37257
-
TYPO3com voted on patch set 7 V +1 10/11/19, 13:05 Completed build in 10m 09s on Fri, 11 Oct, 01:05 PM Test Summary: 47988 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-37261
-
Richard Haeser voted on patch set 7 CR 0 10/23/19, 09:04
-
Richard Haeser commented on patch set 7 CR -1 10/23/19, 09:04
On it -
Richard Haeser commented on patch set 7 CR 0 10/26/19, 07:52
We will add documentation to tell how people can disable rendering of hreflang system-wide. Because the feature should work correctly in 99% of the cases, we won't provide an easy option to disable the feature. If there are issues rendering the tags, we should fix the real problem. -
Richard Haeser abandoned the change 10/26/19, 07:52
We will add documentation to tell how people can disable rendering of hreflang system-wide. Because the feature should work correctly in 99% of the cases, we won't provide an easy option to disable the feature. If there are issues rendering the tags, we should fix the real problem.