Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rakesh.gectcr created an issue. See original summary.

rakesh.gectcr’s picture

Status: Active » Needs review
FileSize
11.46 KB

Status: Needs review » Needs work

The last submitted patch, 2: 2672442-1.patch, failed testing.

rakesh.gectcr’s picture

Status: Needs work » Needs review
FileSize
10.29 KB
899 bytes

Apologize I did a foolish mistake changing in the vendor directory. I have re rolled again, Please review.

Status: Needs review » Needs work

The last submitted patch, 4: 2672442-2.patch, failed testing.

rakesh.gectcr’s picture

FileSize
9.65 KB
rakesh.gectcr’s picture

Status: Needs work » Needs review
jhodgdon’s picture

Version: 8.1.x-dev » 8.0.x-dev
Status: Needs review » Needs work
Parent issue: » #2574981: Fix grammar ("an URL" should be "a URL") and consistent use of URL (not "url" / "Url") in documentation only, part 1

Thanks for the issue and patch! I gather that this issue should be a child of #2574981: Fix grammar ("an URL" should be "a URL") and consistent use of URL (not "url" / "Url") in documentation only, part 1 so adding that.

Also we can update API docs in 8.0.x and 8.1.x, so changing this to an 8.0.x issue to indicate that.

The patch has some problems though, mostly due to one thing.

There is a class called "Url" that exists in Drupal Core. So even though when we're talking about a URL (in the sense of something like "https://www.drupal.org"), the correct capitalization of that is "URL", when we're talking about an object of this class, the correct phrase would be "a Url object". Or really, it should say:
a \Drupal\Core\Url object

So, I've noted where I think in the patch it's referring to the Url object and not a URL string. These all need to be updated, or at least the capitalization should not be changed to "URL" and we can make those changes to "a \Drupal\Core\Url object" in a separate issue if you prefer not to expand the scope here.

  1. +++ b/core/lib/Drupal/Core/Path/PathValidatorInterface.php
    @@ -13,7 +13,7 @@
    +   * Returns a URL object, if the path is valid and accessible.
    

    This is the object. Incorrect caps.

  2. +++ b/core/lib/Drupal/Core/Path/PathValidatorInterface.php
    @@ -24,7 +24,7 @@
    +   * Returns a URL object, if the path is valid.
    

    Object.

  3. +++ b/core/lib/Drupal/Core/Template/TwigExtension.php
    @@ -254,7 +254,7 @@ public function getUrl($name, $parameters = array(), $options = array()) {
    -   * Gets a rendered link from an url object.
    +   * Gets a rendered link from a URL object.
    

    Object.

  4. +++ b/core/modules/language/src/Form/NegotiationUrlForm.php
    @@ -100,7 +100,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
    -      '#description' => $this->t('The domain names to use for these languages. <strong>Modifying this value may break existing URLs. Use with caution in a production environment.</strong> Example: Specifying "de.example.com" as language domain for German will result in an URL like "http://de.example.com/contact".'),
    +      '#description' => $this->t('The domain names to use for these languages. <strong>Modifying this value may break existing URLs. Use with caution in a production environment.</strong> Example: Specifying "de.example.com" as language domain for German will result in a URL like "http://de.example.com/contact".'),
    

    This change does not belong in the patch, since it is UI text. This patch should only be for API documentation. We cannot change UI text for minor things like this in 8.0.x.

  5. +++ b/core/modules/link/src/LinkItemInterface.php
    @@ -41,7 +41,7 @@ public function isExternal();
    -   *   Returns an Url object.
    +   *   Returns a URL object.
    

    Object.

  6. +++ b/core/modules/link/src/Plugin/Field/FieldFormatter/LinkFormatter.php
    @@ -240,7 +240,7 @@ public function viewElements(FieldItemListInterface $items, $langcode) {
    -   *   An Url object.
    +   *   A URL object.
    

    Object.

  7. +++ b/core/modules/rest/src/Tests/AuthTest.php
    @@ -74,7 +74,7 @@ public function testRead() {
    -   *   An Url object.
    +   *   A URL object.
    

    Object.

  8. +++ b/core/modules/views/src/Plugin/views/display/DisplayRouterInterface.php
    @@ -39,7 +39,7 @@ public function collectRoutes(RouteCollection $collection);
    -   * Generates an URL to this display.
    +   * Generates a URL to this display.
        *
        * @return \Drupal\Core\Url
    

    Here it should probably say "a Url object" because that is what is being generated, not really a URL per se.

jhodgdon’s picture

As another note, I think it would be best to do the issues that fix the capitalization first, then go back and fix the "an URL" problems later, but it's up to you. You can also just only do "a" to "an" in this patch if you do not take what was correct capitalization for the object and make it incorrect. That would actually be more in keeping with the stated scope of this issue.

subharanjan’s picture

Assigned: Unassigned » subharanjan
dimaro’s picture

Status: Needs work » Needs review
FileSize
9.1 KB
3.47 KB

@jhodgdon According to the stated scope of this issue, I have only changed "an" to "a" in this patch.
(Task 1 in https://www.drupal.org/node/2574981 - Comment #45)

All instances of "Url" or "url" have been restored to their original state.
The URL capitalization should be performed on another issue, no? All this would be correct?

subharanjan’s picture

Assigned: subharanjan » Unassigned
smukh’s picture

Issue tags: +#drupalconasia2016

I am looking into it.

jeevanbhushetty’s picture

Status: Needs review » Needs work
dimaro’s picture

@jeevanbhushetty See #11.
I think that the URL capitalization should be performed on another issue and in this one we should just change "an" to "a".

jhodgdon’s picture

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

Yes, we are *only* chainging "an" to "a" when "url" (with any capitalization) follows it, and not doing anything about capitalization problems in this issue. And only in API docs, not UI text.

So the changes in the patch are fine. I also verified with grep that it fixes all instances in core of "an url" (any caps).

So thanks for the patch and for making a well-scoped issue! On to the next part in another issue? :)

catch’s picture

Version: 8.0.x-dev » 8.1.x-dev
Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs reroll

Needs a re-roll for 8.1.x.

aditya_anurag’s picture

Status: Needs work » Needs review
FileSize
9.09 KB

I have re rolled against 8.1.x

heykarthikwithu’s picture

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +needs backport to 8.0.x

Thanks! The patch in #18 looks good, and is identical to the patch in #11. Except in #11, this capitalization change shouldn't be made:

+++ b/core/modules/rest/src/Tests/AuthTest.php
@@ -74,7 +74,7 @@ public function testRead() {
-   *   An Url object.
+   *   A URL object.

This should be "A Url object.". I missed that in my earlier review.

So... We can commit the patch in #18 to 8.1.x, and then we need to go back and make a new patch for 8.0.x. Accordingly, setting to RTBC for 8.1.x and tagging with "needs backport" for 8.0.x.

dimaro’s picture

This it's the patch for 8.0.x
This solves a mistake indicated on #20.
Attach interdiff between #11 and #21.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 21: in_the_documentation-2672442-21.patch, failed testing.

jhodgdon’s picture

Status: Needs work » Reviewed & tested by the community

Thanks! So the patch in #18 should be good for 8.1.x, and #21 for 8.0.x.

  • catch committed eb0ed47 on 8.1.x
    Issue #2672442 by rakesh.gectcr, dimaro, aditya_anurag, jhodgdon: In the...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.1.x, thanks!

#21 doesn't apply. I'm going to go ahead and mark this fixed - can re-open if someone re-rolls.

jhodgdon’s picture

Huh? #21 seems to apply to 8.0.x. I went ahead and committed it, after using git diff -- color-words to verify once again that all it does is change an to a before url.

  • jhodgdon committed 2d18988 on 8.0.x
    Issue #2672442 by rakesh.gectcr, dimaro, aditya_anurag, jhodgdon: In the...

Status: Fixed » Closed (fixed)

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