Problem/Motivation
The correct capitalization of "Ajax" is not "AJAX". For confirmation that this is the correct spelling, see:
https://www.drupal.org/node/752056
https://en.wikipedia.org/wiki/Ajax_%28programming%29
https://www.drupal.org/drupalorg/style-guide/content#relatedwords
The Views UI has it capitalized wrong in the view editing form (under Advanced, it says "Use AJAX" not "Use Ajax"). This occurs in several lines in core/modules/views/src/Plugin/views/display/DisplayPluginBase.php. And there is also one place in core/modules/views/src/Plugin/views/display/DisplayPluginBase.php
Also, core/misc/ajax.js has it wrong in several UI messages.
Note: Someone could also make **separate issues** to fix this problem in a VERY LARGE number of places in documentation and code comments, tests, method names, etc., but this issue is just to fix it in the user interface text. It should be a fairly small patch of about 10 changes at most.
Steps to reproduce
Proposed resolution
Determine if this scope here is correct - see that parent issue.
Remaining tasks
Reroll
User interface changes
Yes
| Comment | File | Size | Author |
|---|---|---|---|
| #26 | rerolldiff_24-26.txt | 3.26 KB | ayush.khare |
| #26 | 2788131-26_10.patch | 3.93 KB | ayush.khare |
| #26 | 2788131-26_95.patch | 4.86 KB | ayush.khare |
| #24 | reroll_diff_2-24.txt | 5.06 KB | ravi.shankar |
| #24 | 2788131-24.patch | 4.04 KB | ravi.shankar |
Comments
Comment #2
miteshmapFixed for user interface text only, For views and misc/ajax.js,
Comment #3
dawehnerI think its too late for string changes now.
Comment #4
jhodgdonThis looks like the correct patch to me.
Comment #5
alexpottThank you for spotting this and working on it.
This should be find and replace on core and probably given it is a common error - see how much AJAX there is in core - we should have a coder rule to automatically test. Otherwise we're just going to introduce this again and again and again.
In order to fix core coding standards in a maintainable way, all our coding standards issues should be done on a per-rule basis across all of core, rather than fixing standards in individual modules or files. We should also separate fixes where we need to write new documentation from fixes where we need to correct existing standards. This all should be done as part of #2571965: [meta] Fix PHP coding standards in core, stage 1. A good place to start is the child issues of #2572645: [Meta] Fix 'Drupal.Commenting.FunctionComment' coding standard.
For background information on why we usually will not commit coding standards fixes that aren't scoped in that way, see the core issue scope guidelines, especially the note about coding standards cleanups. That document also includes numerous suggestions for scoping issues including documentation coding standards cleanups.
Contributing to the overall plan above will help ensure that your fixes for core's coding standards remain in core the long term.
Comment #6
jhodgdonYou want to do the code comments, docs comments, and UI text in the same patch? This patch covers the UI text only. I thought that we would normally want the UI patch separate from the comments, but maybe not.
Also, we would need to figure out what to do about method names. Many of them also have AJAX in all caps (even though that actually also violates our standards for CamelCase method names. But probably those mostly cannot be changed, unless they are test methods? not sure.
Anyway, I'll leave it for someone else to supervise this issue...
Comment #7
valthebaldRemoving Novice tag since there is no consensus on solution
Comment #9
jhodgdonThis was unfortunately set back to Needs Work because @alexpott decided the scope was too narrow. Meanwhile, the UI text did not make it in. This was not a coding standards change. This was a UI text change.
Can we just fix the UI text in this issue, and have a separate issue for the documentation and/or coding standards fixes? Please? It is too ambitious to fix the coding standards, write a sniff, etc. We just need to fix the UI in the meantime...
Comment #10
jhodgdonSorry, wrong status. I'll leave this at Needs Work... I don't want to get into an argument.
But I just want to say... I disagree that this is a coding standards issue. It's basically a spelling/style error to write "AJAX" instead of "Ajax". I looked in Coder and didn't find any similar sniffs for this type of spelling/style error or capitalization. And we do already have a standard for writing Ajax not AJAX by the way, at least here:
https://www.drupal.org/drupalorg/style-guide/content#relatedwords
You're right though, AJAX with the incorrect capitalization occurs in 559 lines currently under the core directory in Drupal 8.3.x latest. Ajax with the correct capitalization occurs in 1531 lines, although that probably includes a lot of CamelCase class names (I just did a grep | wc).
But it seems to be a huge burden, that if we want to fix this UI text bug and make the user-facing text correct, we also have to:
- Write a Coder sniff, and get that patch working
- Patch all 549 other instances that aren't UI text
But, whatever. If that's the decision, that's the decision. I'm really not going to say any more (and will unfollow this to make sure).
Comment #21
quietone commentedI agree with jhodgdon that this is spelling issue and not a coding standards issue.
I did a search for AJAX in Drupal 9.5.x which found 731 instances in 244 files. Due to the quantity of changes a Meta issue is needed to oversee the changes and this issue will be a child. I'll make the Meta now.
Spelling issues are tasks not bug, changing category. This could use a reroll, adding tag.
Comment #22
immaculatexavier commentedComment #23
immaculatexavier commentedComment #24
ravi.shankar commentedAdded reroll of patch #2 on Drupal 9.5.x.
Comment #26
ayush.khare commentedReroll #24 for 10.1.x and Fixed CCF for 9.5.x
Comment #27
ayush.khare commentedComment #28
smustgrave commentedThe proposed solution is
Was that done? Can the IS be updated to reflect that.
This is altering the schema won't it need an update hook to trigger?