link.schema.yml uses the following labels.

        absolute:
          type: boolean
          label: 'Is this URL absolute'
        https:
          type: boolean
          label: 'If the URL should use a secure protocol'

Both the labels should be rewritten to be statements rather than questions.

Comments

Kartagis created an issue. See original summary.

kartagis’s picture

Status: Active » Needs review
StatusFileSize
new886 bytes
avpaderno’s picture

Title: Grammatical issue » Fix punctuation in link.schema.yml label
longwave’s picture

Should the https label below be in the form of a question as well? We should probably be consistent, do we have a standard for this?

avpaderno’s picture

@longwave I am not sure there is a standard, but at least the description should be an English phrase/sentence. To me, If the URL should use a secure protocol doesn't seem a phrase an English native speaker would use. I think Does the URL use a secure protocol? sounds better, to me.

pandaski’s picture

+++ b/core/modules/link/config/schema/link.schema.yml
@@ -74,7 +74,7 @@ field.value.link:
-          label: 'Is this URL absolute'

I don't think we have a strict standard.

But a "question mark" here make sense to me.

kartagis’s picture

StatusFileSize
new1.02 KB

Here's another patch fixing both issues.

avpaderno’s picture

Status: Needs review » Needs work
+          label: 'Should use a secure protocol?'

it's missing the subject. (The sentence should be Should the URL use a secure protocol? even if I think Does the URL use a secure protocol? is better.)

prabha1997’s picture

Assigned: Unassigned » prabha1997

I am working on this issue

prabha1997’s picture

Assigned: prabha1997 » Unassigned
Status: Needs work » Needs review
StatusFileSize
new508 bytes
new695 bytes

I uploaded a patch with required changes for label with proper sentence

longwave’s picture

Status: Needs review » Reviewed & tested by the community

Looks great, thanks!

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/modules/link/config/schema/link.schema.yml
@@ -74,10 +74,10 @@ field.value.link:
         absolute:
           type: boolean
-          label: 'Is this URL absolute'
+          label: 'Is this URL absolute?'
         https:
           type: boolean
-          label: 'If the URL should use a secure protocol'
+          label: 'Should the URL use a secure protocol?'

Rather than making up new language we could borrow the documentation. This would be the first use of a question mark in boolean type labels in core.

So mapping from the docs in \Drupal\Core\Url::fromUri() which is what these settings map to we get:
Whether to force the output to be an absolute link (beginning with http:)
Whether this URL should point to a secure location

rithesh bk’s picture

Assigned: Unassigned » rithesh bk
Status: Needs work » Active

currently working on this issue ......

rithesh bk’s picture

Assigned: rithesh bk » Unassigned
Status: Active » Needs work
kishor_kolekar’s picture

Status: Needs work » Needs review
StatusFileSize
new762 bytes
new704 bytes

please review the patch.

avpaderno’s picture

Status: Needs review » Needs work
-          label: 'Is this URL absolute'
+          label: 'Whether to force the output to be an absolute link (beginning with http:)?'

The question mark is not needed. The other labels don't use a period either.

avpaderno’s picture

Issue summary: View changes
jungle’s picture

  1. +++ b/core/modules/link/config/schema/link.schema.yml
    @@ -74,10 +74,10 @@ field.value.link:
    +          label: 'Whether to force the output to be an absolute link (beginning with http:)?'
    

    if it is a secure URL, it's beginning with https: , so beginning with http: is not always true.

    if change it to "Whether to force the output to be an absolute link (beginning with http)", without :, both http: and https: are applicable.

    And should link such as ftp://drupal.org/files/projects/drupal-8.8.2.zip be considered here?

  2. +++ b/core/modules/link/config/schema/link.schema.yml
    @@ -74,10 +74,10 @@ field.value.link:
    +          label: 'Whether this URL should point to a secure location?'
    

    how about "Whether to use https or not? "

    a secure location is not obvious for me to tell where to use https or http. as the key is https.

I am not a native English speaker, so just posting suggestions.

kishor_kolekar’s picture

Status: Needs work » Needs review
StatusFileSize
new760 bytes

@kiamlaluno I have removed question mark. thanks for suggestion.
here is the new patch please review.

avpaderno’s picture

Issue summary: View changes

Whether to force the output to be an absolute link (beginning with http:) and Whether this URL should point to a secure location are taken from the description of the options given in Url::fromUri() as requested from comment #12.

While it's true that Whether to force the output to be an absolute link (beginning with http:) seems to say that a link starting with https: is not an absolute link, Whether to force the output to be an absolute link (beginning with http) would not be correct, since a link starting with http is not absolute. To be absolute, the first part of the link must be the URI scheme, which at least include the colons.

If there is the need to explain what absolute link means, I would use the following labels.

  • Whether to force the output to be an absolute link (beginning with http: or https:)
  • Whether this URL should point to a secure location (beginning with https:)
jungle’s picture

StatusFileSize
new794 bytes

Agree with @kiamlaluno, patch adjusted according to #20

joachim’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

Looks good!

Updated the IS too to match what the patch is now doing.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 21: 3107243-21.patch, failed testing. View results

abhisekmazumdar’s picture

Status: Needs work » Reviewed & tested by the community

Not sure why the patch is failing but this looks good to me.

avpaderno’s picture

The tests are failing because two exceptions.

Drupal\Tests\system\Functional\UpdateSystem\UpdatePathTestBaseFilledTest::testPathAliasProcessing
Exception: Notice: Undefined index: date
update_calculate_project_update_status()() (Line: 503)

Drupal\Tests\config_translation\Functional\ConfigTranslationInstallTest::testConfigTranslation
Exception: Notice: Undefined index: date
update_calculate_project_update_status()() (Line: 503)

They are caused from a undefined index in a function that has not been changed from the patch.

pandaski’s picture

Any blockers to this issue?

catch’s picture

Status: Reviewed & tested by the community » Needs work

The new language implies that if https isn't configured, then the link should not point to a secure location. I think the 'force' language is important here even if we don't use the current wording.

neslee canil pinto’s picture

Status: Needs work » Needs review
StatusFileSize
new799 bytes
new657 bytes
abhisekmazumdar’s picture

Status: Needs review » Reviewed & tested by the community

The patch got apply without any issue and the labels descriptions look good to me. Making this as RTBC.
Thank You

alexpott’s picture

Status: Reviewed & tested by the community » Patch (to be ported)

Committed fb0ced5 and pushed to 9.1.x. Thanks!

Asking release managers if we can backport this to 8.9.x and 9.0.x.

  • alexpott committed fb0ced5 on 9.1.x
    Issue #3107243 by kishor_kolekar, Kartagis, prabha1997, Neslee Canil...
alexpott’s picture

Status: Patch (to be ported) » Fixed

Discussed with @catch and we agree to cherry-pick this to 8.9.x and 9.0.x

  • alexpott committed 4679a0d on 9.0.x
    Issue #3107243 by kishor_kolekar, Kartagis, prabha1997, Neslee Canil...

  • alexpott committed ceaa9a0 on 8.9.x
    Issue #3107243 by kishor_kolekar, Kartagis, prabha1997, Neslee Canil...

Status: Fixed » Closed (fixed)

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