Problem/Motivation

Spelling inconsistencies in API documentation in two cases: \Drupal\Core\Url class and URL

The scope has been reduced based on comments from other contributors.

Proposed resolution

  1. Fix most uses of url/URL/Url in core, but does not have to fix all of them to be committed.
  2. Consistently use "a" rather than "an": "a URL".
  3. Generally use "URL" in generic text, such as "an absolute URL" or "a URL object". See #114
  4. Use the fully qualified class name when referring to a class, such as Drupal\Core\Url. See #114
  5. Be careful when "url" refers to a literal string, such as when documenting the expected keys of an array.

Remaining tasks

  • Address points raised in #125
  • Review
  • Commit

Concerns

Testing issues: Selenium/Webdriver tests may operate in a non-English installation where checkboxes, etc, may be selected by a label (makes tests much more readable) or tests may wait for a confirmation message. But when the label/message changes (back to English, due to lost translations), tests fail. Such tests may just be in various projects, not in core, so updating trivial strings should ideally include fixing .po files at the same time.
Trivial changes like this tend to cause conflicts when merging other, more important, changes.
We have plenty of bigger fish to fry.
Where do we stop?

  • @Mile23 answered the question regarding scope in #91 summarized in the proposed resolution about keeping Url when referencing as an object compared to grammar of URL as an acronym.
  • @wengerk addressed this in the patch in #95.

User interface changes

None

API changes

No structural changes.

Data model changes

No structural changes.

Original report by LoMo

CommentFileSizeAuthor
#144 2574981-144.patch50.84 KB_utsavsharma
#138 diff-124-134.txt35.53 KBquietone
#136 2574981-136.patch61.75 KBpaulocs
#136 interdiff-134-136.txt3.47 KBpaulocs
#134 2574981-134.patch62.36 KBvsujeetkumar
#133 Screenshot from 2021-05-26 14-12-30.png41.99 KBmarcusvsouza
#129 2574981-130.patch64.13 KBSwapnil_Kotwal
#128 2574981_128.patch62.79 KBvsujeetkumar
#125 interdiff-2574981-116-124.txt2.42 KBbenjifisher
#124 2574981-124.patch71.5 KBcosmicdreams
#123 2574981-123.patch71.83 KBm0r1
#116 interdiff-110-116.txt27.42 KBelaman
#116 2574981-116.patch71.82 KBelaman
#110 2574981-110.patch90.92 KBizus
#110 interdiff_108-110.txt1.18 KBizus
#108 2574981-108.patch90.67 KBizus
#108 interdiff_108-104.txt1.17 KBizus
#104 interdiff-2574981-102-104.txt835 byteswengerk
#104 2574981-104.patch90.9 KBwengerk
#102 interdiff-2574981-95-102.txt7.65 KBwengerk
#102 2574981-102.patch91.82 KBwengerk
#95 interdiff-85-95.txt58.04 KBwengerk
#95 2574981-95.patch94.87 KBwengerk
#85 2574981-85.patch86.22 KBjofitz
#82 fix_grammar_an_url-2574981-82.patch84.9 KBdimaro
#82 interdiff-2574981-80-82.txt1.43 KBdimaro
#80 fix_grammar_an_url-2574981-80.patch85.13 KBdimaro
#76 fix_grammar_an_url-2574981-76.patch83.48 KBdimaro
#74 fix_grammar_an_url-2574981-74.patch85.38 KBdimaro
#72 interdiff-2574981-65-67.txt20.24 KBManjit.Singh
#70 2574981-70.patch86.43 KBSumit kumar
#68 2574981-67.patch86.1 KBManjit.Singh
#65 interdiff.txt818 bytesManjit.Singh
#65 2574981-65.patch67.22 KBManjit.Singh
#60 2574981-60.patch67.21 KBManjit.Singh
#57 2574981-57.patch67.03 KBrajeshwari10
#45 2574981-45.patch71.73 KBrakesh.gectcr
#38 interdiff-32-38.txt149.39 KBdarol100
#38 2574981-Fixing-grammar-URL.patch189.09 KBdarol100
#32 interdiff-24-32.txt3.74 KBdarol100
#32 2574981-Fixing-grammar-URL.patch15.8 KBdarol100
#27 2574981-26.txt526 bytesHimanshu5050
#27 fix_grammar-incorrect_vowel_removed-2574981-26.patch526 bytesHimanshu5050
#24 interdiff-20-24.txt4.78 KBsnehi
#24 fix_grammar_a_URL-2574981-24.patch15.48 KBsnehi
#20 fix_grammar_a_URL-2574981-20.patch12.44 KBpguillard
#16 fix_grammar_a_URL-2574981-16.patch15.23 KBcharginghawk
#11 fix_grammar_a_URL-2574981-11.patch15.23 KBsdstyles
#7 fix_grammar_a_URL-2574981-7.patch17.33 KBManjit.Singh
#3 fix_grammar_a_URL-2574981-3.patch18.09 KBpguillard
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

LoMo created an issue. See original summary.

LoMo’s picture

Issue summary: View changes

TLDR; trimmed out the "grammar lesson" and simplified a bit. I do want to find a way we can track strings better, but (something like string IDs) might need to wait for Drupal X (some future time). Clearly the current approach to how we work with translation-strings trivializes the work of translators. We should do our best (now) to try to avoid trivial string changes breaking the translation (when the meaning is clearly still the same). And we should think of what a long-term future solution might look like.

pguillard’s picture

Grammar :
It seems we have an URL more often in comments, not so much in translated strings.

Spelling :
We often also have

returns a Url

which is correct in regard to the Url class.

This is what I get so far...

pguillard’s picture

Status: Active » Needs review
justAChris’s picture

Issue tags: +rc deadline

Marking this as rc deadline since this affects translations. Notes on rc deadline: https://groups.drupal.org/node/484788

Consistency in our text / terminology is definitely a good idea. Whether or not this is ready before rc1, we should see if there are any other similar wording consistency issues already filed.

Also, noting this (old) issue as it relates to translations and matching slightly different strings: #194141: Implement msgmerge type fuzzy matching

Manjit.Singh’s picture

Issue tags: +Needs reroll
Manjit.Singh’s picture

@pguillard I think there is some changes in code, so no need to override in this file now. core/lib/Drupal/Core/Menu/DefaultMenuLinkTreeManipulators.php.

+++ b/core/lib/Drupal/Core/Menu/DefaultMenuLinkTreeManipulators.php
@@ -206,7 +206,7 @@ protected function menuLinkCheckAccess(MenuLinkInterface $instance) {
     }
     else {
-      // Use the definition here since that's a lot faster than creating a Url
+      // Use the definition here since that's a lot faster than creating a URL
       // object that we don't need.
       $definition = $instance->getPluginDefinition();
       // 'url' should only be populated for external links.

Please correct me if i am wrong.

cilefen’s picture

This issue would work better if it were separated into two issues: one for documentation and one for the UI.

LoMo’s picture

Re #8 Is is really necessary? It's not such a big issue that splitting it makes very much sense to me.

Re patch #7: I do see a few issues where we have a double-article "A a" or "an a", etc. In most cases, those were already in the string, but we should get them correct. Also we have comments where we changed to "A URL object", where it really is probably more correct to say "A Url object", since "Url" is the proper class name.

LoMo’s picture

Status: Needs review » Needs work

Should have been set back to "Needs work", at least for the few lines where I spot the mentioned fixes needed. I'll maybe hit that later... need to set the table now. ;-)

sdstyles’s picture

Status: Needs work » Needs review
FileSize
15.23 KB

Changes according to #9

Status: Needs review » Needs work

The last submitted patch, 11: fix_grammar_a_URL-2574981-11.patch, failed testing.

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 11: fix_grammar_a_URL-2574981-11.patch, failed testing.

Status: Needs work » Needs review
charginghawk’s picture

Rerolling #11 after some cleanup.

Status: Needs review » Needs work

The last submitted patch, 16: fix_grammar_a_URL-2574981-16.patch, failed testing.

justAChris’s picture

As suggested in #8, we can split the documentation edits from the UI updates. This would allow the rc deadline tag to be changed to rc eligible for the documentation updates only. Then, a separate issue for the UI updates can be filed, which should be postponed until 8.1.x dev is opened.

@LoMo, what do you think of that approach, or should we really keep this all together and postpone everything?

Additionally, this one doesn't follow our pattern and should be updated

+++ b/core/modules/views/src/Plugin/views/display/DisplayRouterInterface.php
@@ -39,7 +39,7 @@ public function collectRoutes(RouteCollection $collection);
    *   A URL object for the display.
cilefen’s picture

Re #18, if it is not split, this issue must move to 8.1.x because it modifies translatable strings.

pguillard’s picture

Status: Needs work » Needs review
FileSize
12.44 KB

As suggested by cilefen and justAChris (#8 and #18), this patch is only keeping the documentation edits.

Because I dont't see an answer from LoMo, I let you add the rc eligible tag.

pguillard’s picture

Created the related issue for UI updates, postponed, for 8.1.x dev.

LoMo’s picture

@justAChris Sorry, I've been "in-transit" between Germany and the U.S. the past day, so this is the first I've logged in here. I agree with the approach (splitting off the UI-visible stuff) since we missed getting this in before the RC deadline. As I initially stated, I still have reservations about this kind of "fix", anyway. This ticket was created as an example issue for the need for automation of tracking trivial changes to source strings and allowing them to be updated in all the .po files. Otherwise, the extra trouble for translators (and broken tests, etc) is just too great for the benefit of such improvements, IMHO.

Thanks for creating the 8.1.x issue, @pguillard.

justAChris’s picture

Title: Fix grammar ("an URL" should be "a URL") and consistent use of URL (not "url" / "Url") » Fix grammar ("an URL" should be "a URL") and consistent use of URL (not "url" / "Url") in documentation only
Issue tags: -rc deadline +rc eligible

Updating title to reflect that the scope of this issue is documentation only. Changing out rc deadline to rc eligible since patches containing doc improvements only are allowed during rc.

snehi’s picture

Status: Needs review » Needs work

The last submitted patch, 24: fix_grammar_a_URL-2574981-24.patch, failed testing.

Himanshu5050’s picture

Removed incorrect vowels

Himanshu5050’s picture

The last submitted patch, 24: fix_grammar_a_URL-2574981-24.patch, failed testing.

cilefen’s picture

@Himanshu5050 Your patch in #27 seems to have lost all the prior improvements that were in #24.

The last submitted patch, 24: fix_grammar_a_URL-2574981-24.patch, failed testing.

darol100’s picture

darol100’s picture

Status: Needs work » Needs review

The last submitted patch, 20: fix_grammar_a_URL-2574981-20.patch, failed testing.

The last submitted patch, 24: fix_grammar_a_URL-2574981-24.patch, failed testing.

YesCT’s picture

Status: Needs review » Needs work
  1. +++ b/core/lib/Drupal/Core/Path/PathValidatorInterface.php
    @@ -13,7 +13,7 @@
    -   * Returns an URL object, if the path is valid and accessible.
    +   * Returns a Url object, if the path is valid and accessible.
    
    @@ -24,7 +24,7 @@
    -   * Returns an URL object, if the path is valid.
    +   * Returns a Url object, if the path is valid.
    

    changes the case of URL the wrong way.

  2. +++ b/core/modules/filter/src/Tests/FilterDefaultConfigTest.php
    @@ -22,7 +22,7 @@ class FilterDefaultConfigTest extends KernelTestBase {
    -    // Drupal\filter\FilterPermissions::permissions() builds an URL to output
    +    // Drupal\filter\FilterPermissions::permissions() builds a URL to output
         // a link in the description.
    

    I think the a can be wrapped on the previous line.

  3. +++ b/core/modules/link/src/LinkItemInterface.php
    @@ -38,10 +38,10 @@
    -   * Gets the URL object.
    +   * Gets the Url object.
    ...
    -   *   Returns an Url object.
    +   *   Returns a Url object.
    

    case wrong here too.

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

    and here.

  5. +++ b/core/modules/simpletest/src/WebTestBase.php
    @@ -2934,7 +2934,7 @@ protected function prepareRequestForGenerator($clean_urls = TRUE, $override_serv
    -   * Builds an a absolute URL from a system path or a URL object.
    +   * Builds an absolute URL from a system path or a Url object.
    

    missed case change.

  6. +++ b/vendor/behat/mink/src/Driver/CoreDriver.php
    @@ -72,7 +72,7 @@ public function reset()
    -        throw new UnsupportedDriverActionException('Visiting an url is not supported by %s', $this);
    +        throw new UnsupportedDriverActionException('Visiting an URL is not supported by %s', $this);
    

    missed the an a change

I'll work on a grep that we can use to check before and after.

YesCT’s picture

grep -R -E "\/\/ | \* |\/\*\*| \*\/" core | grep -E " an Url| an URL| Url | url "

get's pretty close at listing them. might miss some, might overcount some.

but... in head

grep -R -E "\/\/ | \* |\/\*\*| \*\/" core | grep -E " an Url| an URL| Url | url " | wc -l
is 190

and with the patch it is
175

so there are bunch this is not catching

darol100’s picture

Status: Needs work » Needs review
FileSize
189.09 KB
149.39 KB

I have rebuild this patch with #37 suggestions.

After applying this patch if you run this command grep -R -E "\/\/ | \* |\/\*\*| \*\/" core | grep -E " an Url| an URL| Url | url " you are going to see

core/assets/vendor/jquery/jquery.js:		// If url is an object, simulate pre-1.5 signature
core/assets/vendor/jquery/jquery.js:		// Handle falsy url in the settings object (#10093: consistency with old signature)
core/assets/vendor/jquery/jquery.js:		// We also use the url parameter if available
core/assets/vendor/jquery/jquery.js:		// Add anti-cache in url if needed
core/assets/vendor/jquery/jquery.js:		// Insert callback into url or form data
core/assets/vendor/jquery/jquery.js: *             Load a url into a page

I did not edit anything on core/assets/vendor/* because we cant edit vendors files.

justAChris’s picture

Regarding #36.1, 3, 4, 5, those were initially left as "Url" since when referring to the Url object, the mixed case version was used. See comment #3.

However, perhaps for sake of simplicity in our conventions in documentation, it should always be uppercase URL as suggested in #36, even when referring to the object/class.

YesCT’s picture

ohhhhh. hm.

alexpott’s picture

Status: Needs review » Needs work

I'm not sure about the latest patch on this issue. For example:

  1. +++ b/core/core.api.php
    @@ -2227,9 +2227,9 @@ function hook_validation_constraint_alter(array &$definitions) {
    - *   - url: For a bar progress indicator, URL path for determining progress.
    + *   - URL: For a bar progress indicator, URL path for determining progress.
    ...
    - * - url: A \Drupal\Core\Url to which to submit the Ajax request. If omitted,
    + * - URL: A \Drupal\Core\Url to which to submit the Ajax request. If omitted,
    

    These are array keys.

  2. +++ b/core/includes/common.inc
    @@ -133,7 +133,7 @@
    - * Prepares a 'destination' URL query parameter for use with url().
    + * Prepares a 'destination' URL query parameter for use with URL().
    

    This is just in correct as the url() function does not exist.

  3. +++ b/core/includes/common.inc
    @@ -213,11 +213,11 @@ function valid_email_address($mail) {
    - *   Use UrlHelper::stripDangerousProtocols() or UrlHelper::filterBadProtocol()
    - *   instead. UrlHelper::stripDangerousProtocols() can be used in conjunction
    + *   Use URLHelper::stripDangerousProtocols() or URLHelper::filterBadProtocol()
    + *   instead. URLHelper::stripDangerousProtocols() can be used in conjunction
    ...
    - *   UrlHelper::filterBadProtocol() is functionality equivalent to check_url()
    + *   URLHelper::filterBadProtocol() is functionality equivalent to check_url()
    

    It is UrlHelper

Re the review in #36 - we need to be careful here because the Url object is Drupal\Core\Url. That said the class docblock from that class is Defines an object that holds information about a URL.

priya.chat’s picture

Assigned: Unassigned » priya.chat
priya.chat’s picture

Assigned: priya.chat » Unassigned
rakesh.gectcr’s picture

Assigned: Unassigned » rakesh.gectcr
rakesh.gectcr’s picture

Assigned: rakesh.gectcr » Unassigned
Status: Needs work » Needs review
FileSize
71.73 KB

@alexpott

According to your comment , I understand that we need to changes only the word
url => URL or
Url => URL , and
an URL => a URL.

I created the new patch only with these changes.

And I am not changed in .js files

antojose’s picture

Status: Needs review » Needs work

This would make a good novice issue, which though simple in the task to be done, requires quite care in the fact that "url" can appear both in the comments as well as code.

Discussed this with xjm, and she suggested the following:

1) Since it has been over 3 months since the patch was made, we cannot use the patch as is. We would have to re-roll the patch for the new codebase.

2) It would be better to split this task into 3 individual tasks.
Task 1: Only in the documentation, change all instances of "an URL" to "a URL".
Task 2: Only in the documentation, change all instances of "url" to "URL".
Task 3: Only in the documentation, change all instances of "Url" to "URL".

jhodgdon’s picture

Category: Task » Plan
Issue tags: -rc eligible +Needs issue summary update

Um. I'd just like to point out that the issue summary here and component are about UI text, not API documentation, even though the patch seems to be mostly API documentation fixes.

We should eventually fix both. So probably instead of splitting into 3 issues, we should have a 4th that is 8.1.x only, and addresses all 3 problems in UI text, if in fact there are any of those.

Oh, I see there is also a postponed (why???) child issue for the UI part. That is good.

When you make additional issues for the API docs, please:
- Make their parent issue be this issue.
- File them in component "documentation".

Meanwhile, this issue needs a new summary and the component should probably be documentation? Is this one just a "meta" (plan) issue now? I am not sure what your plan is but the issue summary and title and component do not match each other, and none of them reflects what the plan seems to be.

rakesh.gectcr’s picture

Assigned: Unassigned » rakesh.gectcr
rakesh.gectcr’s picture

#2672442: In the documentation, change all instances of "an URL" to "a URL". Ones that is fixed, I will be working on another issues.

justAChris’s picture

Regarding #2585989: Fix grammar and consistent use of URL / UI PART as questioned in #47, that can be un-postponed at this point. I'm fairly certain that was only postponed because the issue was created before 8.1.x was open for development. That issue affects translatable strings, which can only be updated during minor releases, so its eligibility for 8.1.x is time limited as 8.1.0 enters beta.

jhodgdon’s picture

I'm un-postponing the other issue. While looking into whether there are additions needed to that patch, I came across one more sort-of related thing to cover in this issue: there are a lot of mentions in comments/docs about "the url() function", which no longer exists in Drupal 8. Those should also be fixed on a child issue.

rakesh.gectcr’s picture

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

pguillard’s picture

Assigned: rakesh.gectcr » Unassigned
Manjit.Singh’s picture

Issue tags: +DevDaysMilan

The last submitted patch, 45: 2574981-45.patch, failed testing.

rajeshwari10’s picture

Status: Needs work » Needs review
FileSize
67.03 KB

Rerolled the patch for 8.1.x.

rodrigoac’s picture

In line 107 still have a lower case 'url'.

stpaultim’s picture

Status: Needs review » Needs work

Marking this issue as "Needs work" again to account for #58.

Manjit.Singh’s picture

Status: Needs work » Needs review
FileSize
67.21 KB

change url to uppercase. Please review.

dimaro’s picture

Looking at the child issue,
#2672442: In the documentation, change all instances of "an URL" to "a URL".

The changes applied on the latest patch would be correct?

Sabbi0612’s picture

Hi @Manjit.Singh,

I reviewed your patch.
There were some discrepancies that I observed while testing.
The issues w.r.t the consistency of "url" keyword were on the following lines of the file "b/core/includes/form.inc"
- 252
- 239
- 504
- 509

There may be more like these.
Please Rectify.

Cheers.

kattekrab’s picture

+++ b/core/includes/theme.inc
@@ -608,8 +608,8 @@ function template_preprocess_datetime_wrapper(&$variables) {
+ *     - url: (optional) The URL object to link to. If omitted, no a tag is

This should be "no anchor tag" instead of "no a tag" as it appears here.

joelpittet’s picture

Version: 8.1.x-dev » 8.3.x-dev
Status: Needs review » Needs work

@kattekrab, or this too: "no <a> tag" is acceptable to be clear, but yeah "a tag" is not clear.

setting to needs work for #62 and #63

Manjit.Singh’s picture

Status: Needs work » Needs review
Issue tags: +Dublin2016
FileSize
67.22 KB
818 bytes

Here are the changes as per#63

joelpittet’s picture

Status: Needs review » Needs work

@Manjit.Singh could you run the grep command in #37, there are some new ones to fix up. Thanks for fixing #63

dimaro’s picture

@Manjit.Singh @joelpittet #65 This patch is not outside the scope of the task? (Changes the different ways to show "URL")

On the other hand, I worked on the following issue #2710685: inconsistent use of tags in docs for template_preprocess_links()
I think that the latest patch apply on the same function template_preprocess_datetime_wrapper, I'm wrong?

Manjit.Singh’s picture

Status: Needs work » Needs review
FileSize
86.1 KB

@Joelpittet here we go :)

joelpittet’s picture

Status: Needs review » Needs work

Thanks @Manjit.Singh, from previous patches I think the changes from Url to URL are incorrect when the refer to the Url object, those will need to be reverted out of this patch, your latest changes look correct for the new changes though.

@dimaro, I think your patch is correct thanks, that is in reference to this comment too about objects and should be reverted from this patch's scope.

Sumit kumar’s picture

Status: Needs work » Needs review
FileSize
86.43 KB
joelpittet’s picture

Category: Plan » Task

@Manjit.Singh @Sumar kumar what did you change in #68 and #70, could you provide a interdiff please? Here's how if you haven't before: https://www.drupal.org/documentation/git/interdiff

Also there are still a bunch of references to Url object that need to be left alone and reverted from the patch please.

Manjit.Singh’s picture

FileSize
20.24 KB

@Joelpittet here is the interdiff of #65 and #67. Can you please verify and check where i have changed the object to URL.
thanks.

Status: Needs review » Needs work

The last submitted patch, 70: 2574981-70.patch, failed testing.

dimaro’s picture

Status: Needs work » Needs review
FileSize
85.38 KB

Rerolled the latest patch #70

Status: Needs review » Needs work

The last submitted patch, 74: fix_grammar_an_url-2574981-74.patch, failed testing.

dimaro’s picture

Status: Needs work » Needs review
FileSize
83.48 KB

Rerolled #74.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

cilefen’s picture

cilefen’s picture

Status: Needs review » Needs work

#2851394: Fix grammar 'a' to 'an' when necessary has been opened to fix all documentation "a" vs "an" problems, which I think is a worthy cause.

The most recent patch on this issue changes things like "For example", which to me seem to have nothing at all to do with the title or the issue summary. So I feel we should re-scope and refocus this issue to being 'Fix consistent use of "URL" in documentation', do only that, and let's get it done.

Please pay attention to #71. It is important to understand when we are talking about the Url class or a URL (the thing we visit in a web browser).

I am setting this to "needs work" for those changes.

dimaro’s picture

Status: Needs work » Needs review
FileSize
85.13 KB

RE #79: @cilefen Thanks for your comments, I totally agree.
I think that we only should to fix the use of "URL", the latest patch no longer applies, reroll #76 against 8.4.x.

Please pay attention to #71. It is important to understand when we are talking about the Url class or a URL (the thing we visit in a web browser).

Work in progress!

Status: Needs review » Needs work

The last submitted patch, 80: fix_grammar_an_url-2574981-80.patch, failed testing.

dimaro’s picture

Status: Needs work » Needs review
FileSize
1.43 KB
84.9 KB

Oops! Apologies.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

joelpittet’s picture

Issue tags: +Vienna2017, +Needs reroll

Was reviewing but the patch isn't applying and needs a reroll.

Mostly in the test files but some others as well.

jofitz’s picture

Re-rolled (and added a few more that have been introduced since the previous patch).

jofitz’s picture

Issue tags: -Needs reroll

Forgot to remove the "Needs re-roll" tag.

al0a’s picture

Status: Needs review » Reviewed & tested by the community

I've read through the hole patch, it does what is suppose to do.

mradcliffe’s picture

Status: Reviewed & tested by the community » Needs work

Thank you for the patch and review.

The issue is still marked as Needs issue summary update, and I agree with this. The issue summary has a section labeled "Concerns", and it looks like the scope of the issue was changed. This would probably make the issue harder to review for core commiters when they look at their RTBC issue queue. @jhodgdon mentioned it in comment #57.

Can we clarify what the scope of the issue is in the issue summary using the Issue summary template?

al0a’s picture

Issue summary: View changes
al0a’s picture

Status: Needs work » Needs review
Issue tags: -Needs issue summary update
Mile23’s picture

Issue summary: View changes
Status: Needs review » Needs work

Thanks for working on this.

There are definitely scope issues here.

I only got about halfway through, so the same set of problems probably apply to other parts of the patch.

  1. +++ b/core/includes/theme.inc
    @@ -613,8 +613,8 @@ function template_preprocess_datetime_wrapper(&$variables) {
    - *     - url: (optional) The \Drupal\Core\Url object to link to. If omitted, no
    ...
    + *     - url: (optional) The URL object to link to. If omitted, no anchor tag
    

    \Drupal\Core\Url is a class of object. This should remain specific to the class name.

  2. +++ b/core/includes/form.inc
    @@ -774,7 +774,7 @@ function batch_set($batch_definition) {
      * @param \Drupal\Core\Url|string $redirect
    - *   (optional) Either path or Url object to redirect to when the batch has
    + *   (optional) Either path or URL object to redirect to when the batch has
    

    Url (with that capitalization) refers to the \Drupal\Core\Url class.

  3. +++ b/core/includes/theme.inc
    @@ -613,8 +613,8 @@ function template_preprocess_datetime_wrapper(&$variables) {
    - *     - url: (optional) The \Drupal\Core\Url object to link to. If omitted, no
    ...
    + *     - url: (optional) The URL object to link to. If omitted, no anchor tag
    

    Again, \Drupal\Core\Url is valuable information about the name of a class, and doesn't refer to a URL.

  4. +++ b/core/lib/Drupal.php
    @@ -580,7 +580,7 @@ public static function linkGenerator() {
    -   * Renders a link with a given link text and Url object.
    +   * Renders a link with a given link text and URL object.
    

    Again, in this case, Url refers to a Url object, not a URL.

  5. +++ b/core/lib/Drupal/Core/Authentication/AuthenticationProviderFilterInterface.php
    @@ -8,9 +8,8 @@
    + * E.g., there are good reasons to restrict insecure methods like HTTP basic
    

    E.g. is somewhat worse than 'for instance.' It's also out of scope here, so please revert this change.

  6. +++ b/core/lib/Drupal/Core/Link.php
    @@ -62,12 +62,12 @@ public static function createFromRoute($text, $route_name, $route_parameters = [
    -   * Creates a Link object from a given Url object.
    +   * Creates a Link object from a given URL object.
    ...
        * @param \Drupal\Core\Url $url
    -   *   The Url to create the link for.
    +   *   The URL to create the link for.
    
    +++ b/core/lib/Drupal/Core/Menu/MenuLinkInterface.php
    @@ -201,7 +201,7 @@ public function getFormClass();
    -   *   A Url object, or NULL if there is no route (e.g. when the link is not
    +   *   A URL object, or NULL if there is no route (e.g. when the link is not
    
    @@ -214,7 +214,7 @@ public function getDeleteRoute();
        * @return \Drupal\Core\Url|null
    -   *   A Url object, or NULL if there is no route because there is no custom
    +   *   A URL object, or NULL if there is no route because there is no custom
    
    @@ -223,7 +223,7 @@ public function getEditRoute();
        * @return \Drupal\Core\Url|null
    -   *   A Url object, or NULL if there is no route (e.g. when the link is not
    +   *   A URL object, or NULL if there is no route (e.g. when the link is not
    
    +++ b/core/lib/Drupal/Core/Menu/menu.api.php
    @@ -290,7 +290,7 @@ function hook_menu_links_discovered_alter(&$links) {
    - *   - url: a Url object.
    
    +++ b/core/lib/Drupal/Core/Render/Element/PathElement.php
    @@ -67,10 +67,10 @@ public static function validateMatchedPath(&$element, FormStateInterface $form_s
    -        // We do the value conversion here whilst the Url object is in scope
    
    +++ b/core/lib/Drupal/Core/Url.php
    @@ -96,7 +96,7 @@ class Url {
        * In most cases, use Url::fromRoute() or Url::fromUri() rather than
    -   * constructing Url objects directly in order to avoid ambiguity and make your
    +   * constructing URL objects directly in order to avoid ambiguity and make your
    
    @@ -119,7 +119,7 @@ public function __construct($route_name, $route_parameters = [], $options = [])
    -   * Creates a new Url object for a URL that has a Drupal route.
    +   * Creates a new URL object for a URL that has a Drupal route.
    
    @@ -133,7 +133,7 @@ public function __construct($route_name, $route_parameters = [], $options = [])
        * @return \Drupal\Core\Url
    -   *   A new Url object for a routed (internal to Drupal) URL.
    +   *   A new URL object for a routed (internal to Drupal) URL.
    
    @@ -160,7 +160,7 @@ public static function fromRouteMatch(RouteMatchInterface $route_match) {
    -   * Creates a Url object for a relative URI reference submitted by user input.
    +   * Creates a URL object for a relative URI reference submitted by user input.
    
    @@ -189,7 +189,7 @@ public static function fromRouteMatch(RouteMatchInterface $route_match) {
        * @return static
    -   *   A new Url object based on user input.
    +   *   A new URL object based on user input.
    
    @@ -210,7 +210,7 @@ public static function fromUserInput($user_input, $options = []) {
    -   * Creates a new Url object from a URI.
    +   * Creates a new URL object from a URI.
    
    @@ -322,7 +321,7 @@ public static function fromUri($uri, $options = []) {
    -   * Create a new Url object for entity URIs.
    +   * Create a new URL object for entity URIs.
    
    @@ -333,7 +332,7 @@ public static function fromUri($uri, $options = []) {
        * @return \Drupal\Core\Url
    -   *   A new Url object for an entity's canonical route.
    +   *   A new URL object for an entity's canonical route.
    
    @@ -348,7 +347,7 @@ protected static function fromEntityUri(array $uri_parts, array $options, $uri)
    -   * Creates a new Url object for 'internal:' URIs.
    
    @@ -383,7 +382,7 @@ protected static function fromEntityUri(array $uri_parts, array $options, $uri)
        * @return \Drupal\Core\Url
    -   *   A new Url object for a 'internal:' URI.
    +   *   A new URL object for a 'internal:' URI.
    
    @@ -420,7 +419,7 @@ protected static function fromInternalUri(array $uri_parts, array $options) {
    -   * Creates a new Url object for 'route:' URIs.
    
    @@ -432,7 +431,7 @@ protected static function fromInternalUri(array $uri_parts, array $options) {
        * @return \Drupal\Core\Url
    -   *   A new Url object for a 'route:' URI.
    
    @@ -452,21 +451,21 @@ protected static function fromRouteUri(array $uri_parts, array $options, $uri) {
    -   * Returns the Url object matching a request.
    +   * Returns the URL object matching a request.
    ...
        * SECURITY NOTE: The request path is not checked to be valid and accessible
    -   * by the current user to allow storing and reusing Url objects by different
    +   * by the current user to allow storing and reusing URL objects by different
    ...
    -   * router name and parameters stored in the Url object returned by this
    +   * router name and parameters stored in the URL object returned by this
    ...
        * @return static
    -   *   A Url object. Warning: the object is created even if the current user
    +   *   A URL object. Warning: the object is created even if the current user
    
    @@ -483,7 +482,7 @@ public static function createFromRequest(Request $request) {
    -   * Sets this Url to encapsulate an unrouted URI.
    
    @@ -499,7 +498,7 @@ protected function setUnrouted() {
    -   * Generates a URI string that represents the data in the Url object.
    +   * Generates a URI string that represents tha data in the URL object.
    
    @@ -507,7 +506,7 @@ protected function setUnrouted() {
    -   *   A URI representation of the Url object data.
    +   *   A URI representation of the URL object data.
    
    @@ -525,7 +524,7 @@ public function toUriString() {
    -   * Indicates if this Url is external.
    +   * Indicates if this URL is external.
    
    @@ -534,7 +533,7 @@ public function isExternal() {
    -   * Indicates if this Url has a Drupal route.
    +   * Indicates if this URL has a Drupal route.
    
    @@ -693,7 +692,7 @@ public function mergeOptions($options) {
    -   * Returns the URI value for this Url object.
    +   * Returns the URI value for this URL object.
    
    @@ -715,7 +714,7 @@ public function getUri() {
    -   *   (optional) Whether to make this Url absolute or not. Defaults to TRUE.
    +   *   (optional) Whether to make this URL absolute or not. Defaults to TRUE.
    
    @@ -725,12 +724,12 @@ public function setAbsolute($absolute = TRUE) {
    -   * Generates the string URL representation for this Url object.
    +   * Generates the string URL representation for this URL object.
    ...
    -   * If this Url object was constructed from a Drupal route or from an internal
    +   * If this URL object was constructed from a Drupal route or from an internal
    
    @@ -793,7 +792,7 @@ public function getInternalPath() {
    -   * Checks this Url object against applicable access check services.
    +   * Checks this URL object against applicable access check services.
    
    @@ -812,13 +811,13 @@ public function access(AccountInterface $account = NULL) {
    +   * Checks a URL render element against applicable access check services.
    

    Again, same class name problem.

  7. +++ b/core/lib/Drupal/Core/Url.php
    @@ -254,8 +254,7 @@ public static function fromUserInput($user_input, $options = []) {
        * @return \Drupal\Core\Url
    -   *   A new Url object with properties depending on the URI scheme. Call the
    -   *   access() method on this to do access checking.
    +   *   A new URL object with properties depending on the URI scheme.
    

    I just wanted to point out here that an issue with scope like this should never change the documentation in a substantive way.

  8. +++ b/core/modules/ckeditor/js/ckeditor.js
    @@ -115,7 +115,26 @@
     
    -    openDialog: function openDialog(editor, url, existingValues, saveCallback, dialogSettings) {
    +    /**
    +     * Open a dialog for a Drupal-based plugin.
    +     *
    +     * This dynamically loads jQuery UI (if necessary) using the Drupal AJAX
    +     * framework, then opens a dialog at the specified Drupal path.
    +     *
    +     * @param {CKEditor} editor
    +     *   The CKEditor instance that is opening the dialog.
    +     * @param {string} url
    +     *   The URL that contains the contents of the dialog.
    +     * @param {object} existingValues
    +     *   Existing values that will be sent via POST to the URL for the dialog
    +     *   contents.
    +     * @param {function} saveCallback
    +     *   A function to be called upon saving the dialog.
    +     * @param {object} dialogSettings
    +     *   An object containing settings to be passed to the jQuery UI.
    +     */
    +    openDialog: function (editor, url, existingValues, saveCallback, dialogSettings) {
    +      // Locate a suitable place to display our loading indicator.
           var $target = $(editor.container.$);
    

    Please open another issue for this documentation.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

joshmiller’s picture

Issue tags: +Nashville2018
leanderl’s picture

I'm at the Code Sprint, DrupalCon Nashville, 2018 and will look at this issue for a bit.

The patch 2574981-85.patch doesn't work on current dev (8.6.x) and I'm not sure how to refactor it. Any tips are welcome. Is there a specific methodology for refactoring patches?

Abandoning this task, any other code sprinter is welcome to pick it up!

wengerk’s picture

Re-rolled for 8.6.x (and added a few more that have been introduced since the previous patch).

I also apply suggestions of #91. Plus, I found a couple of others "out-of-scope addition" that I revert:

  1.   /**
       * Converts a field id into a formatted URL path.
       *
       * @example
       * Drupal.quickedit.util.buildUrl(
       *   'node/1/body/und/full',
       *   '/quickedit/form/!entity_type/!id/!field_name/!langcode/!view_mode'
       * );
       *
       * @param {string} id
       *   The id of an editable field.
       * @param {string} urlFormat
       *   The Controller route for field processing.
       *
       * @return {string}
       *   The formatted URL.
       */
    

    core/modules/quickedit/js/util.js

  2.   /**
       * Attaches the tour's toolbar tab behavior.
       *
       * It uses the query string for:
       * - tour: When ?tour=1 is present, the tour will start automatically after
       *   the page has loaded.
       * - tips: Pass ?tips=class in the URL to filter the available tips to the
       *   subset which match the given class.
       *
       * @example
       * http://example.com/foo?tour=1&tips=bar
       *
       * @type {Drupal~behavior}
       *
       * @prop {Drupal~behaviorAttach} attach
       *   Attach tour functionality on `tour` events.
       */
    

    core/modules/tour/js/tour.js

  3. -
    +    // Get viewPath URL without baseUrl portion.
          var viewHref = Drupal.url(viewPath).substring(drupalSettings.path.baseUrl.length);
    
    
    -
    +    // 3 is the length of the '?q=' added to the URL without clean urls.
          if (href.substring(0, 3) === '?q=') {
            href = href.substring(3, href.length);
    core/modules/views/js/base.js
    

As explain by #91 an issue with scope like this should never change the documentation in a substantive way.
Please open another issues for this documentation.

wengerk’s picture

Status: Needs work » Needs review
ifrik’s picture

If I get this correctly, the use of URL in user interface text is already fixed in #2585989: Fix grammar and consistent use of URL / UI PART, and this issue is now only about the use of URL in documentation in the code?
If so the issue summary and component needs updating.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

annajl’s picture

Component: user interface text » documentation
Issue summary: View changes
Issue tags: +MWDS2018

I updated the issue summary and component to reflect the scope changes for this issue.

annajl’s picture

wengerk’s picture

Issue tags: +Needs reroll
wengerk’s picture

Here is the reroll on 8.7.x

mradcliffe’s picture

Issue summary: View changes
Status: Needs review » Needs work

I reorganized the issue summary a bit, and added a bit about what in comment #91 answers the scope of the issue. Thank you, annajl.

I looked at the attached patch, and found this:

diff --git a/core/modules/views/js/base.js b/core/modules/views/js/base.js
index be522cf5aa..ca18fbe581 100644
--- a/core/modules/views/js/base.js
+++ b/core/modules/views/js/base.js
@@ -29,7 +29,6 @@
   Drupal.Views.parseViewArgs = function (href, viewPath) {
     var returnObj = {};
     var path = Drupal.Views.getPath(href);
-
     var viewHref = Drupal.url(viewPath).substring(drupalSettings.path.baseUrl.length);
 
     if (viewHref && path.substring(0, viewHref.length + 1) === viewHref + '/') {
@@ -50,7 +49,6 @@
   Drupal.Views.getPath = function (href) {
     href = Drupal.Views.pathPortion(href);
     href = href.substring(drupalSettings.path.baseUrl.length, href.length);
-
     if (href.substring(0, 3) === '?q=') {
       href = href.substring(3, href.length);
     }
@@ -62,4 +60,4 @@
     }
     return href;
   };
-})(jQuery, Drupal, drupalSettings);
\ No newline at end of file
+})(jQuery, Drupal, drupalSettings);

According to the top of that file, it shouldn't be modified manually. I ran `yarn install`, `yarn run build:js`, `yarn run prettier` but I did not get this change on latest 8.7.x.

wengerk’s picture

Status: Needs work » Needs review
FileSize
90.9 KB
835 bytes

Thanks for spotting this !

Indeed I forget to follow the new workflow of Prettier with Core JavaScript. My bad.

Here is the correction from #103.

spitzialist’s picture

Working on this at #drupaleurope

spitzialist’s picture

Assigned: Unassigned » spitzialist
spitzialist’s picture

Assigned: spitzialist » Unassigned
Status: Needs review » Needs work

I've quickly checked the files and all changes:

- In file /core/modules/simpletest/src/WebTestBase.php, line 2004 the line "A system path or a URL." was changed to "A system path or a Url." which is not correct in my opinion. Here is should remain "A system path or a URL." from my point of view as it is not referring to the Url object. If it does refer to the Url object, one should write "Url object" to make it clear here.

- In file /core/tests/Drupal/Tests/UiHelperTrait.php, line 370 the line "A system path or a URL." was changed to "A system path or a Url." which is not correct in my opinion. Here is should remain "A system path or a URL." from my point of view as it is not referring to the Url object. If it does refer to the Url object, one should write "Url object" to make it clear here.

All other changes look fine to me and are consistent with the description of the issue.

izus’s picture

Status: Needs work » Needs review
FileSize
1.17 KB
90.67 KB

Hi,
here is a patch that adresses #107
Thanks

wengerk’s picture

Status: Needs review » Needs work

Re: #107 & #108

Both class UiHelperTrait & WebTestBase clearly need a string or an Url object (see the @param hint), it has been change in #108 with A system path or a URL., but I kind of disagree with thoses two changes, I think it should be A system path or a Url object.

What do you think ?

izus’s picture

Status: Needs work » Needs review
FileSize
1.18 KB
90.92 KB

Hi,
following patch adresses #109
Thanks

wengerk’s picture

Thanks for the changes @izus !

For me it's RTBC. Let's see what does the community thinks about the suggestions of #107, #108 & #109.

Anyone else want to review / test / RTBC?
Thanks!

hugovk’s picture

Status: Needs review » Reviewed & tested by the community

RTBC, LGTM!

Would be really nice to get this in before this issue's 3rd birthday on Tuesday :)

The last submitted patch, 95: 2574981-95.patch, failed testing. View results

catch’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/lib/Drupal/Core/Link.php
@@ -109,8 +109,8 @@ public function getUrl() {
-   *   The URL object to set
+   * @param URL $url
+   *   The Url object to set
    *

This is inconsistent, and I think it shows that the distinction between 'an object referring to a URL' and 'an instance of the Url class' in the summary is too subtle for us apply consistently everywhere.

For me I'd just use URL everywhere, including when referring to an instance of Url (because it's an object representing a URL, so URL is as correct), and that then works for URL generator/UrlGenerator too - where the class name capitalisation is UrlGenerator/Url Generator, but in the patch it is URL generator.

volkswagenchick’s picture

Issue tags: +fldc19, +sfdug, +dcnj19

Tagging for upcoming contribution days.

elaman’s picture

Status: Needs work » Needs review
FileSize
71.82 KB
27.42 KB

Latest patch didn't apply cleanly to the HEAD. I've rerolled it also accounting for @catch'es comment.

Christie Alcidor’s picture

Status: Needs review » Reviewed & tested by the community
mradcliffe’s picture

Status: Reviewed & tested by the community » Needs review

Hi, @Christie Alcidor. Thank you for moving this issue forward.

Could you describe what you did to review the latest patch that would make it RTBC? It helps a lot to be descriptive about what we reviewed and how, as well as any questions or doubts we had while reviewing and what the answers were. In this case I think it would help to provide a review to confirm @catch's comments were addressed by the patch in #116 and there were no unintended side effects in the patch.

Darren Oh’s picture

I have to disagree with catch’s suggestion to use URL everywhere. Using Url to refer to an instance of the Url class is a helpful distinction for me as a reader. Keeping it shows that we actually understand the documentation we create. Using URL generator to refer to implementations of the UrlGeneratorInterface interface is fine because we are describing a class rather than referring to it by name.

Christie Alcidor’s picture

@mradcliffe it's good to use.

volkswagenchick’s picture

Issue tags: -fldc19, -dcnj19 +midcamp2019

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

m0r1’s picture

Changed one comment line to capitalize URL for consistency. Caught this one with dreditor. No other changes. Just walking through the process for the first time. interdiff to come when I learn how to generate that.

cosmicdreams’s picture

M0r1 sitting with cosmicdreams to update this patch. Changes one line on menu.api.php to capitalize URL. Did not go through the entire patch and review all cases of URL. Still needs a full review. We are releasing this patch to experience the patch release process.

benjifisher’s picture

Status: Needs review » Needs work
Issue tags: +Seattle2019, +Needs issue summary update
FileSize
2.42 KB

I have uploaded an interdiff, comparing the patches in #116 and #124. See Creating an interdiff in the Getting Involved guide.

Just looking at those differences, I notice this from the patch in #124:

+++ b/core/lib/Drupal/Core/Menu/menu.api.php
@@ -247,9 +247,9 @@
  *     translated, create a \Drupal\Core\StringTranslation\TranslatableMarkup
  *     object.
  *   - route_name: (optional) The route name to be used to build the path.
- *     Either the route_name or url element must be provided.
+ *     Either the route_name or URL element must be provided.
  *   - route_parameters: (optional) The route parameters to build the path.
- *   - url: (optional) If you have an external link use this element instead of
+ *   - URL: (optional) If you have an external link use this element instead of

This comment documents the (string) keys that can be used in an array. That is, each of these is a literal string. For ease of reading, the quotation marks have been left off, but we could have written 'route_name', 'route_parameters', and 'url'. Since there is a real difference between 'url' and 'URL', I think the change in the last line is a mistake.

More broadly, I think we need to reach consensus on a few points and document these in the issue summary. (Reaching agreement will save us the trouble of making patches that are not likely to be approved. Documenting in the issue summary will make it easier for people who want to review the patches here.) Here are my recommendations:

  1. Scope: this issue aims to fix most uses of url/URL/Url in core, but does not have to fix all of them to be committed.
  2. Consistently use "a" rather than "an": "a URL".
  3. Generally use "URL" in generic text, such as "an absolute URL" or "a URL object".
  4. Use the fully qualified class name when referring to a class, such as Drupal\Core\Url.
  5. Be careful when "url" refers to a literal string, such as when documenting the expected keys of an array.

Feel free to add to this list AND to discuss these recommendations. A few of my reasons:

I include (1) because we have a moving target and because I do not want to impose an unreasonable burden on anyone reviewing patches for this issue.

I include (3) and (4) because I agree with #114. Even if I disagreed, I would include it, since I usually defer to core committers.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

vsujeetkumar’s picture

Status: Needs work » Needs review
FileSize
62.79 KB

Re-roll patch created for 9.1.x, Please review

Swapnil_Kotwal’s picture

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

quietone’s picture

Postponed the child issue, #2676182: In the documentation, change all instances of "url" to "URL"., on resolving the points raised in #125. Note the IS for that issue says it is for the files in core/modules, although the patch covers all of core and is much that same as this one.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

marcusvsouza’s picture

Issue summary: View changes
FileSize
41.99 KB

The patch in comment #129 it's corrupted in line 1375 as the image attached shows.

vsujeetkumar’s picture

Re-roll patch created for 9.3.x. and fixed that "corrupted in line 1375" issue.

quietone’s picture

Issue summary: View changes

@marcusvsouza, thanks for the interest in this work. The fact that the patch does not apply is not really a problem here. What needs to be done here is resolve the points raised in #125.

paulocs’s picture

marcusvsouza’s picture

The patch on comment 136 applies correctly and meets the requirements of comment 125.

quietone’s picture

Issue summary: View changes
FileSize
35.53 KB

I came back to review this issue and immediately see that the remaining task is to address the issues raised in #125. I see no discussion of that yet. I have added those points to the IS as the proposed resolution and removed the previous proposal.

I do agree with the proposed resolution.

There has been no interdiff from #124 to #134, so I have added a diff. That is not something I normally do as a reviewer.

Updated to remove the screenshot of applying a patch.

@marcusvsouza, as I mentioned in #135 the work here is to address the points in #125. Adding screenshot and comments that a patch applies does not help move an issue forward. The contributor guide on Drupal.org has information about how to contribute, particularly the process to Review a patch or merge request. There are also clear guidelines for How is credit granted for Drupal core issues. Therefore removing credit.

I hope to come back within a few days and review.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

smustgrave’s picture

Status: Needs review » Needs work

Does not apply to 10.1 and need to confirm the points in #125 have been addressed.

smustgrave’s picture

Issue tags: +Needs reroll

This needs a reroll for 10.1

_utsavsharma’s picture

Rerolled for 10.1.x. Made changes against Patch #136.
These files are not present in 10.1.x:
FeedInterface.php
AggregatorTestBase.php
ckeditor.es6.js
LinkFieldRdfaTest.php
ConfirmFormTest.php
tour.es6.js
ajax_view.es6.js
base.es6.js

baikho’s picture

Status: Needs work » Needs review
benjifisher’s picture

I asked for an issue summary update in #125. @quietone addressed that in #135 and #138, so I am removing the issue tag.

The "needs reroll" tag was added in #143. There is a new patch in #144, so I am removing that issue tag.

Creating the patch may be a Novice task, but the next steps are not, so I am removing that issue tag.

mlncn’s picture

Status: Needs review » Reviewed & tested by the community

Amazing how much work goes into a 'simple' documentation-only consistent terminology fix!

The latest patch addresses everything in #125, in particular not incorrectly capitalizing literal string keys.

  • xjm committed 00bcd174 on 10.1.x
    Issue #2574981 by Manjit.Singh, dimaro, wengerk, darol100, izus,...

  • xjm committed 48056da4 on 10.1.x
    Issue #2574981 followup by xjm: Fix 'TTests'.
    

  • xjm committed 7fcd5dd8 on 10.0.x
    Issue #2574981 followup by xjm: Fix 'TTests'.
    
    (cherry picked from...

  • xjm committed 589fa449 on 10.0.x
    Issue #2574981 by Manjit.Singh, dimaro, wengerk, darol100, izus,...

  • xjm committed 7ea72c95 on 9.5.x
    Issue #2574981 followup by xjm: Fix 'TTests'.
    
    (cherry picked from...

  • xjm committed fdaf91a5 on 9.5.x
    Issue #2574981 by Manjit.Singh, dimaro, wengerk, darol100, izus,...
xjm’s picture

Title: Fix grammar ("an URL" should be "a URL") and consistent use of URL (not "url" / "Url") in documentation only » Fix grammar ("an URL" should be "a URL") and consistent use of URL (not "url" / "Url") in documentation only, part 1
Status: Reviewed & tested by the community » Fixed
Issue tags: +Needs followup

I applied the patch locally and reviewed it with git diff --staged --color-words to ensure all the changes were correct and stayed within scope. The only issue I found was:

+++ b/core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php
@@ -612,12 +612,12 @@ public function providerTestExternalIsLocal() {
-   * Tests invalid url arguments.
+   * TTests invalid URL arguments.

Oops, typo here -- a double T.

I then grepped the codebase for instances of " url" and " Url" in documentation lines. I've manually removed things where url is part of a permission string or array key only (versus a word in a sentence.) There are still a LOT left with the patch applied.

From:

[ayrton:drupal | Thu 15:33:42] $ grep -r " url" * | grep "\* " | grep -v "vendor" | grep -v "node_modules"

These still have lowercase uses that need to be changed:

core/tests/Drupal/Tests/Core/DrupalTest.php:   * Tests the urlGenerator() method.
core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php:   * Enhances test urls with schemes.
core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php:   *   The list of urls.
core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php:   * Enhances test urls with prefixes.
core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php:   *   The list of urls.
core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php:   * Tests detecting external urls that point to local resources.
core/includes/theme.inc: *     route_name + route_parameters or url (path), language, and query options
core/lib/Drupal/Core/Entity/Controller/EntityController.php:   * The url generator.
core/lib/Drupal/Core/Mail/MailFormatHelper.php:   * Internal array of urls replaced with tokens.
core/lib/Drupal/Core/Routing/RouteProvider.php:   * restrictions on the url. That case is considered a not found - returning
core/lib/Drupal/Core/Routing/RouteProvider.php:   *   RouteCollection with all urls that could potentially match $request.
core/lib/Drupal/Core/Routing/UrlGenerator.php:   * The path processor to convert the system path to one suitable for urls.
core/lib/Drupal/Core/Routing/UrlGenerator.php:   *   The path processor to convert the system path to one suitable for urls.
core/lib/Drupal/Core/Routing/RouteProviderInterface.php:   * restrictions on the url. That case is considered a not found - returning
core/lib/Drupal/Core/EventSubscriber/MaintenanceModeSubscriber.php:   *   The url generator.
core/lib/Drupal/Core/Utility/LinkGenerator.php:   *   The url generator.
core/lib/Drupal/Core/Utility/LinkGenerator.php:   *   The link text, url, and other options.
core/modules/jsonapi/tests/src/Functional/NodeTest.php:   * Tests PATCHing a node's path with and without 'create url aliases'.
core/modules/file/tests/src/Kernel/FileUrlTest.php: * Tests the file url.
core/themes/olivero/templates/navigation/menu.html.twig: *   - url: The menu link url, instance of \Drupal\Core\Url
core/themes/olivero/templates/navigation/menu--primary-menu.html.twig: *   - url: The menu link url, instance of \Drupal\Core\Url
core/themes/olivero/templates/navigation/menu--secondary-menu.html.twig: *   - url: The menu link url, instance of \Drupal\Core\Url

From:

[ayrton:drupal | Thu 15:40:35] $ grep -r " url" * | grep " // " | grep -v "vendor" | grep -v "node_modules"
core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBase.php:    // Set the update url. This must be set here rather than in
core/tests/Drupal/Tests/BrowserTestBase.php:    // Generate a route to prime the url generator with the correct base url.
core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php:      // Invalid destination urls.
core/lib/Drupal/Core/Form/ConfirmFormHelper.php:        // Suppress the exception and fall back to the form's cancel url.
core/lib/Drupal/Core/Asset/JsOptimizer.php:    // Remove JS source and source mapping urls or these may cause 404 errors.
core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php:      // entity's url. Since we don't know what the markup of the entity will
core/lib/Drupal/Core/Command/DbCommandBase.php:    // Load connection from a url.
core/lib/Drupal/Core/Installer/Form/SelectLanguageForm.php:      // removed from the url.
core/modules/jsonapi/tests/src/Kernel/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php:        // Ensure that resource link contains url with the alias field.
core/modules/file/tests/src/Functional/DownloadTest.php:    // Try requesting the private file url without a file specified.
core/modules/views_ui/tests/src/Functional/DisplayPathTest.php:    // Links should be url-encoded.
core/modules/views_ui/src/ViewEditForm.php:      // Find out the first display which has a changed path and redirect to this url.
core/modules/toolbar/tests/src/Nightwatch/Tests/toolbarApiTest.js:        // Clear escapeAdmin url values.
core/modules/toolbar/tests/src/Nightwatch/Tests/toolbarTest.js:        // Clear escapeAdmin url values.
core/modules/language/tests/src/Functional/LanguageBrowserDetectionAcceptLanguageTest.php:    // Set language detection to url and browser detection.
core/modules/language/tests/src/Kernel/EntityUrlLanguageTest.php:    // from overwriting the url.
core/modules/user/tests/src/Functional/UserPasswordResetTest.php:    // Ensure that the current url does not contain the hash and timestamp.
core/modules/user/src/Plugin/views/argument_validator/UserName.php:    // argument so it works for example for generation summary urls.
core/modules/forum/src/Controller/ForumController.php:          // the url.
core/modules/system/tests/src/Functional/System/AdminTest.php:    // match the redirected url.
core/modules/system/tests/src/Kernel/Mail/MailTest.php:    // Test root relative urls.
core/modules/system/tests/src/Kernel/Mail/MailTest.php:    // Test protocol relative urls.
core/modules/system/tests/src/Kernel/Mail/MailTest.php:    // Test absolute urls.
core/modules/taxonomy/tests/src/Functional/TermAutocompleteTest.php:    // Retrieve the autocomplete url.
core/modules/taxonomy/tests/src/Functional/Views/TaxonomyIndexTidUiTest.php:    // Visit the view's page url and validate the results.
core/modules/ckeditor5/ckeditor5.module:        // CSS url is external or relative to Drupal root.
core/modules/ckeditor5/ckeditor5.module:        // CSS url is relative to theme.
core/modules/filter/filter.module:  // and allow @ in a url, but only in the middle. Catch things like http://example.com/@user/
core/modules/node/tests/src/Functional/NodeTranslationUITest.php:    // Need to check from the beginning, including the base_path, in the url
core/modules/views/js/ajax_view.js:        // If there is a '?' in ajaxPath, clean url are on and & should be
core/modules/views/js/base.js:    // Get viewPath url without baseUrl portion.
core/modules/views/js/base.js:    // 3 is the length of the '?q=' added to the url without clean urls.
core/modules/views/tests/src/Functional/Plugin/DisplayTest.php:    // Test more link with absolute url.
core/modules/views/tests/src/Functional/Plugin/DisplayTest.php:    // Test more link with query parameters in the url.
core/modules/views/tests/src/Functional/Plugin/DisplayTest.php:    // Test more link with fragment in the url.
core/modules/views/src/Plugin/views/display/DisplayPluginBase.php:    // Return the display URL if there is no custom url.
core/modules/views/src/Plugin/views/display/DisplayPluginBase.php:    // Create url.

From:
[ayrton:drupal | Thu 15:36:55] $ grep -r " Url" * | grep " \* " | grep -v "vendor" | grep -v "node_modules"

The following are outstanding. Many refer to "Url object" and might mean that in the sense that they are Drupal\Core\Url objects, but describing them in a sentence "URL object" is more correct if we're not using the full namespace. Or, basically, I disagree with #107 and agree with #114. :)

core/tests/Drupal/Tests/Core/Form/FormSubmitterTest.php:   * Tests redirectForm() when a redirect is a Url object.
core/tests/Drupal/Tests/Core/Template/TwigSandboxTest.php:   * Tests that safe methods inside Url objects can be called.
core/tests/Drupal/Tests/Core/UrlTest.php:   *   An array of Url objects.
core/tests/Drupal/Tests/Core/UrlTest.php:   *   An array of Url objects.
core/tests/Drupal/Tests/Core/UrlTest.php:   *   An array of Url objects.
core/tests/Drupal/Tests/Core/UrlTest.php:   *   An array of Url objects.
core/tests/Drupal/Tests/ApiRequestTrait.php:   * convert Drupal Url objects to strings.
core/includes/form.inc: *   (optional) Either a path or Url object to redirect to when the batch has
core/lib/Drupal/Core/Link.php:   * Creates a Link object from a given Url object.
core/lib/Drupal/Core/Link.php:   *   The Url to create the link for.core/lib/Drupal/Core/File/FileUrlGeneratorInterface.php: * as plain strings or Url objects, depending on the requirements. In general,
core/lib/Drupal/Core/File/FileUrlGeneratorInterface.php:   *   For a local URL (matching domain), a base-relative Url object containing
core/lib/Drupal/Core/File/FileUrlGeneratorInterface.php:   *   a URL that may be used to access the file. An Url object with absolute
core/lib/Drupal/Core/File/FileUrlGeneratorInterface.php:   *   setAbsolute() on the Url object to build an absolute URL.
core/lib/Drupal/Core/Url.php:   * Constructs a new Url object.
core/lib/Drupal/Core/Url.php:   * constructing Url objects directly in order to avoid ambiguity and make your
core/lib/Drupal/Core/Url.php:   * Creates a new Url object for a URL that has a Drupal route.
core/lib/Drupal/Core/Url.php:   *   A new Url object for a routed (internal to Drupal) URL.
core/lib/Drupal/Core/Url.php:   * Creates a Url object for a relative URI reference submitted by user input.
core/lib/Drupal/Core/Url.php:   *   A new Url object based on user input.
core/lib/Drupal/Core/Url.php:   * Creates a new Url object from a URI.
core/lib/Drupal/Core/Url.php:   *   A new Url object with properties depending on the URI scheme. Call the
core/lib/Drupal/Core/Url.php:   * Create a new Url object for entity URIs.
core/lib/Drupal/Core/Url.php:   *   A new Url object for an entity's canonical route.
core/lib/Drupal/Core/Url.php:   * Creates a new Url object for 'internal:' URIs.
core/lib/Drupal/Core/Url.php:   *   A new Url object for an 'internal:' URI.
core/lib/Drupal/Core/Url.php:   * Creates a new Url object for 'route:' URIs.
core/lib/Drupal/Core/Url.php:   *   A new Url object for a 'route:' URI.
core/lib/Drupal/Core/Url.php:   * Returns the Url object matching a request.
core/lib/Drupal/Core/Url.php:   * by the current user to allow storing and reusing Url objects by different
core/lib/Drupal/Core/Url.php:   * router name and parameters stored in the Url object returned by this
core/lib/Drupal/Core/Url.php:   *   A Url object. Warning: the object is created even if the current user
core/lib/Drupal/Core/Url.php:   * Generates a URI string that represents the data in the Url object.
core/lib/Drupal/Core/Url.php:   *   A URI representation of the Url object data.
core/lib/Drupal/Core/Url.php:   * Returns the URI value for this Url object.
core/lib/Drupal/Core/Url.php:   * Sets the value of the absolute option for this Url.
core/lib/Drupal/Core/Url.php:   * Generates the string URL representation for this Url object.
core/lib/Drupal/Core/Url.php:   * If this Url object was constructed from a Drupal route or from an internal
core/lib/Drupal/Core/Url.php:   * Checks this Url object against applicable access check services.
core/lib/Drupal/Core/Menu/MenuLinkInterface.php:   *   A Url object, or NULL if there is no route (e.g. when the link is not
core/lib/Drupal/Core/Menu/MenuLinkInterface.php:   *   A Url object, or NULL if there is no route because there is no custom
core/lib/Drupal/Core/Menu/MenuLinkInterface.php:   *   A Url object, or NULL if there is no route (e.g. when the link is not
core/lib/Drupal/Core/Menu/menu.api.php: *   - url: a Url object.
ore/modules/jsonapi/src/JsonApiResource/Link.php:   *   The Url object for the link.
core/modules/jsonapi/src/JsonApiResource/Link.php:   *   The link's URI as a Url object.
core/modules/jsonapi/src/JsonApiResource/ResourceObject.php:   * Gets a Url for the ResourceObject.
core/modules/menu_link_content/src/MenuLinkContentInterface.php:   *   A Url object instance.
core/modules/link/src/LinkItemInterface.php:   *   Returns a Url object.
core/modules/link/src/Plugin/Field/FieldFormatter/LinkFormatter.php:   *   A Url object.
core/modules/field_ui/src/Form/EntityDisplayFormBase.php:   * Returns the Url object for a specific entity (form) display edit form.
core/modules/field_ui/src/Form/EntityDisplayFormBase.php:   *   A Url object for the overview route.
core/modules/views/src/Plugin/views/display/DisplayPluginBase.php:   *   The more link as Url object.
core/modules/views/src/ViewExecutable.php:   * Gets the Url object associated with the display handler.
core/modules/rest/tests/src/Functional/ResourceTestBase.php:   * convert Drupal Url objects to strings.
core/themes/claro/claro.theme: * $link['#options']['attributes'] and from the Url object's.

From:
[ayrton:drupal | Thu 15:47:04] $ grep -r " Url" * | grep " // " | grep -v "vendor" | grep -v "node_modules"

core/lib/Drupal/Core/Render/Element/PathElement.php:        // We do the value conversion here whilst the Url object is in scope
core/modules/link/tests/src/Unit/Plugin/Validation/Constraint/LinkAccessConstraintValidatorTest.php:      // Mock a Url object that returns a boolean indicating user access.
core/modules/views/src/Plugin/views/field/FieldPluginBase.php:    // Build the link based on our altered Url object, adding on the optional
core/modules/views/src/Plugin/views/row/RssFields.php:    // it through a Url object to allow outbound path processors to run (path
core/themes/claro/claro.theme:  // the attributes of the Url object are processed during rendering.

That is so many things that I would actually like to commit this issue, with the "TTests" thing fixed, and then have a followup for all those other ones. So, I fixed that on commit:

diff --git a/core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php b/core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php
index 61262997dc..2b540e3980 100644
--- a/core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php
+++ b/core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php
@@ -636,7 +636,7 @@ public function providerTestExternalIsLocal() {
   }
 
   /**
-   * TTests invalid URL arguments.
+   * Tests invalid URL arguments.
    *
    * @param string $url
    *   The URL to test.

So, there are two followup issues to handle, IMO. One where url is used in a sentence and obviously wrong, and one where we can disagree about whether a Url object is correct or not.

Meanwhile, pushed to 10.1.x, and cherry-picked to 10.0.x and 9.5.x. Thanks everyone for your persistence on this issue! Let's create those two followup issues.

xjm’s picture

Status: Fixed » Closed (fixed)

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

quietone’s picture

quietone credited anavarre.

quietone credited capysara.

quietone credited jungle.

quietone credited klausi.

quietone credited Lal_.

quietone credited mohrerao.

quietone credited pk188.

quietone’s picture