Problem/Motivation
The spelling of the word writeable/writable is not consistent in core. Either spelling is correct.
Proposed resolution
Core uses 'writeable' 22 times and 'writable' 154 times.
The PHP standard library has a function named is_writable()
, which Core uses 36 times; and an alias of that function named is_writeable()
, which core does not use (as of commit 3834d60f1a
).
Given that 'writable' already occurs more often than 'writeable', it makes sense for us change to 'writable' in this patch.
Out of scope
Drupal core also defines three functions with the less-used spelling 'writeable'...
\Drupal\Component\PhpStorage\PhpStorageInterface::writeable()
\Drupal\Component\PhpStorage\FileStorage::writeable()
\Drupal\Component\PhpStorage\FileReadOnlyStorage::writeable()
... (and there are some tests for these functions which use the incorrect name) ... but changing these would break backwards compatibility, and is therefore out-of-scope for this patch.
Remaining tasks
Write a patch- Review by searching latest code with
grep -r 'writeable' /path/to/core
User interface changes
All instances of writeable change to writable
API changes
N/A
Data model changes
N/A
Release notes snippet
N/A
Original report by gnikolovski
The spelling of the word writeable/writable is not consistent in core. Core use ‘writeable’ 22 times and ‘writable’ 154 times. (#9)
Possible resolutions:
- Change all instances of ‘writeable’ to ‘writable’
- Change all instances of ‘writable’ to ‘writeable’
- Leave as-is. Either spelling is correct.
Comment | File | Size | Author |
---|---|---|---|
#94 | 2898947-8.9.x-94.patch | 6.95 KB | jungle |
#94 | 2898947-9.x-94.patch | 6.9 KB | jungle |
Comments
Comment #2
gnikolovskiComment #4
cilefen CreditAttribution: cilefen at Institute for Advanced Study commentedComment #5
gnikolovskiNot sure how this failed, but I'm changing status back to Needs review.
Comment #7
riddhi.addweb CreditAttribution: riddhi.addweb at AddWeb Solution Pvt. Ltd. commentedThanks Goran for patch, I have checked issue in simplytest.me and after applying your patch given typo solved.
PFA Screenshots for the same.
Comment #8
Wim LeersComment #9
xjm@Jigar.addweb, there is no reason to test a code comment change on simplytest.me, nor to post screenshots of applying a patch. I'm removing the issue credit for this.
This issue also made me do a double-take because "writeable" is actually the spelling I would use. http://www.dictionary.com/browse/writeable gives it as an allowed alternate spelling, my browser does not mark "writeable" as misspelled, and we actually have both in core:
In fact we even have a method named
writeable()
.At a minimum, we'd have to adopt one spelling over the other everywhere, but I'm not even sure we need to change it as both spellings are allowed.
Also, we generally expect core to be spellchecked in one go rather than fixing one-off spelling errors. See: #2829185: Fix spelling errors in Drupal core comments
Setting "Needs review" for more discussion.
Comment #10
xjmComment #12
chiranjeeb2410 CreditAttribution: chiranjeeb2410 at Google Summer of Code commentedPatch contains all keyword changes from "writable" to "writeable", in the /Form directory only.
Also, as suggested by @xjm in #9, "writeable" seems apt as it's not regarded as misspelt and is also present in
form of the writeable() method, which seems to suffice for now.
Comment #13
bhanuprakashnani CreditAttribution: bhanuprakashnani at Google Summer of Code commentedPatch applies cleanly. Changes made are sufficient.
Comment #14
MaskyS CreditAttribution: MaskyS at Google Code-In commentedComment #15
larowlanThere was no response to the questions in #9
It looks like we decided to go with writeable but there was no dicsussion.
In addition, @xjm asked for this to be part of #2829185: Fix spelling errors in Drupal core comments
I'm not sure the discussion has concluded here yet.
Setting back to needs review
Comment #16
bhanuprakashnani CreditAttribution: bhanuprakashnani at Google Summer of Code commentedPatch applies cleanly.
Comment #17
bhanuprakashnani CreditAttribution: bhanuprakashnani at Google Summer of Code commentedComment #18
bhanuprakashnani CreditAttribution: bhanuprakashnani at Google Summer of Code commentedThe patch applies cleanly without errors. The changes made are sufficient.
Comment #19
alexpott@bhanuprakashnani thanks for taking time to apply the patch. However before setting the patch to rtbc all the feedback from the comments needs to be accounted for. In this case especially #15 which points out that consensus on what Drupal should use, writable or writeable, has not been reached. Additionally #9 points out:
Comment #20
quietone CreditAttribution: quietone as a volunteer commentedWikitonary, dictionary.com and thefreedictionary give both spellings. However, Merriam-Webster has an entry for 'writable' but not 'writeable', which redirects to 'writable'.
Since both are acceptable spellings then lets accept them, and enjoy the freedom of being able to spell a word correctly two different ways. Yet, I can think of one case were having both would be a problem for me and that would be if a comment referred to a method/function named 'writeable' in a comment as 'writable'. Still, there are only 176 instances to check for that, according to the grep in #9.
Comment #21
MaskyS CreditAttribution: MaskyS at Google Code-In commentedI'd like to add here that Collins English Dictionary and https://en.oxforddictionaries.com have definitions for 'writable' but not for 'writeable'. Macmillan and Longman do not have definitions for either. 'writable' looks like a better choice to me as it's more widespread. :)
Comment #22
ddavidd CreditAttribution: ddavidd commentedI updated the summary in hopes of get this issue resolved. I think the spelling of writeable/writable is a matter of preference, and I would opt to leave this and every other spelling as-is.
Comment #23
maliknaik CreditAttribution: maliknaik at Google Summer of Code commentedI've tested 2898947-12.patch and it applies cleanly. This patch follows the drupal's coding standards.
Comment #24
cyrilrex CreditAttribution: cyrilrex commentedMy opinion is "writable" word is the correct one to use in all places.
Comment #25
mmjvb CreditAttribution: mmjvb as a volunteer commentedMy preference would be for leaving as-is, apart from bad references (writable) to writeable function.
Comment #28
librarylasso CreditAttribution: librarylasso commentedHi all,
I'm at the newB session at Drupalcon, and I'm going to take a look at this!
Liz
Comment #29
librarylasso CreditAttribution: librarylasso commentedGoing with the dictionary spelling (comment #9), here is a patch for using writable throughout core instead of writeable.
Comment #30
m0r1 CreditAttribution: m0r1 as a volunteer commentedThis looks good. Seems like you caught every instance of "writeable" in that file.
Comment #31
mmjvb CreditAttribution: mmjvb as a volunteer commentedThat looks really bad! Simply not acceptable
Again ignoring what was said and railroading their own opinion. There is no consensus, so no patch should be provided nor reviewed. It is completely irrelevant whether it applies. In addition, failing to understand you simply don't change a public function just because you can!
Also, the patch should NOT change the scope. The issue and discussion is about the use of the word in comments!
Comment #32
sakshi@17 CreditAttribution: sakshi@17 as a volunteer commentedComment #33
volkswagenchickTagging for DrupalNorth 2019
Comment #34
AkashKumar07 CreditAttribution: AkashKumar07 commentedComment #35
AkashKumar07 CreditAttribution: AkashKumar07 commentedComment #37
AkashKumar07 CreditAttribution: AkashKumar07 at OpenSense Labs commentedComment #39
jordanwood CreditAttribution: jordanwood at Northern Commerce commentedUpdated issue summary to clarify what spelling we will be going with.
Comment #40
jordanwood CreditAttribution: jordanwood at Northern Commerce commentedUpdate issue title to better reflect the change we decided to make.
Comment #41
jordanwood CreditAttribution: jordanwood at Northern Commerce commentedRe-roll patch for branch 8.9.x (As of commit 9ef14c6195). No interdiff is necessary because no changes were made.
Comment #42
jordanwood CreditAttribution: jordanwood at Northern Commerce commentedThere are more instances of the word 'writeable' but they are function names and this is a documentation patch, so this can be left as a future issue.
Comment #43
shimpyhii @jordanwood
I have recreated a patch with the suggestions for more files with spelling replacement from writeable to writable.
Please review.
Comment #44
mparker17@shimpy, thank you for the patch; but changing the function names changes Drupal's API, and I believe that is beyond the scope of this novice documentation task.
Changing Drupal's API is a backwards compatibility break, because doing so would break existing contributed and custom modules written for Drupal 8 which relied on the functions that were renamed.
I was working with @jordanwood on the patch he posted in #41; and I suggested that he post the message in #42 to help reviewers understand why grepping Drupal core for "writeable" would still return results; so I take responsibility for the confusion.
Comment #45
mparker17Clarified scope in the issue summary.
Comment #46
shimpyhii @mparker17
Thanks for clearifying the issue summary. It will better help reviewers to review the patch now.
Comment #47
shimpyI have tested patch #41 by grepping. Except the functions the writeabe word is replaced by writable. Attaching the screenshot for same as well. This patch works for me.
Comment #49
mparker17I think a cURL error might be testbot having a bad day... going to set this back to "RTBC" and see if it just starts working again.
Comment #51
xjmWe can file a followup for the method names -- we'd create new versions spelled
writable
, make the old versions wrappers of the new ones, and then deprecate the old ones.Comment #52
xjm#40 also does not apply to 9.1.x. So, we need a 9.1.x version of #40 (which will probably also work for 9.0.x). For clarity, we can also re-upload #40 in the same comment as the 8.9.x version of the patch (since there was an invalid patch between that one and here). Thanks!
Comment #53
xjmHowever, since this is eligible for commit to all four branches as a docs fix, filing against 8.8.x. (You can test the patches against other branches when you upload them by setting the "Test with" select field next to the upload button.)
Comment #54
xjm(As an aside, in my head, I read "writable" as "writ-able", like, you could provide a writ for it? 😂But it is indeed a correct spelling, and more common that "writeable" in our codebase, plus PHP natively has is_writable(), so that's probably preferred.)
Comment #55
Lal_Comment #56
mmjvb CreditAttribution: mmjvb as a volunteer commentedScope creep. For BC reasons don't change function names, not even in 9.1.
Comment #57
Lal_Comment #58
shimpy#57 looks good to me. successfully applied and change the writeable to writable wherever neccesary except the functions call
Comment #59
xjmMoving back to 8.8.x; see #53. If necessary we can create separate patches for separate branches and choose the branch to test with when they're uploaded.
@Lal_, when you create patches, please provide an interdiff so we can review your changes. Also please read the issue more carefully as we already made it clear that only documentation should be changed.
This is an internal API change and should be reverted.
We also still need that followup to deprecate "writeable" methods and change the test methods.
I'll have to take a close look at the patches in this issue when determining credit, as there have been a number of patches that did not take into account the instructions of the issue and that just repeated the work of others. It's very important to read the issue and comments before creating a patch, and to build on the work of other contributors rather than just starting over with your own version.
Thanks for your work contributing to core!
Comment #60
saurabh-2k17 CreditAttribution: saurabh-2k17 at Srijan | A Material+ Company for Drupal India Association commentedHi @xjm as per your suggestion. I have created the interdiff aas well as removed that section which you were pointing out to be changed.
Comment #61
saurabh-2k17 CreditAttribution: saurabh-2k17 at Srijan | A Material+ Company for Drupal India Association commentedComment #62
daffie CreditAttribution: daffie commentedPatch does not apply.
Comment #63
mrinalini9 CreditAttribution: mrinalini9 at Srijan | A Material+ Company for Drupal India Association commentedPlease review this patch as #60 failed to apply.
Comment #64
ankitsingh0188#63 Patch Applied. Looks good to me.
Thanks
Comment #65
jungleI'd postpone this on #2972224: Add .cspell.json to automate spellchecking in Drupal core, but leave the status untouched, what if someone unhappy with this :)
Comment #66
daffie CreditAttribution: daffie commentedAll the changes in the patch look good. I still find 1 occurrence in the file: "core/tests/Drupal/FunctionalJavascriptTests/WebDriverTestBase.php"
There is still a followup issue to be created.
Comment #67
ankitsingh0188Unable to find "writeable" word in the "core/tests/Drupal/FunctionalJavascriptTests/WebDriverTestBase.php" file.
As well as there's no "writeable" word left in the CORE.
Comment #68
daffie CreditAttribution: daffie commented@ankit.singh: You are right. In 8.8 there is no occurrence of the word "writeable". In 9.0 and 9.1 there is an occurrence. See: https://git.drupalcode.org/project/drupal/-/blob/9.1.x/core/tests/Drupal.... As a result of that difference there need to be 2 patches: one for 8.x and one for 9.x.
Comment #69
ankitsingh0188Hi @daffie,
I have created the patch for 9.x and search "writeable" in the core, now there's no occurrence of "writeable" except the functions call.
Comment #70
ankitsingh0188Comment #71
daffie CreditAttribution: daffie commentedThe followup that @xjm is asking for in comment #59 still needs to be done.
Comment #72
ankitsingh0188I think #59 issue is resolved in patch #63 for version 8.8 and I did the same in patch #70 for version 9.x
Comment #73
daffie CreditAttribution: daffie commentedThe 2 patches from comments #63 and #70 are together for me RTBC.
The by @xjm requested followup still needs to be created. After that is done, is it for me RTBC.
Comment #74
codersukanta CreditAttribution: codersukanta at Srijan | A Material+ Company for Drupal India Association commentedSuccessfully applied both the patch from #63 and #70.
Regarding #63: "writeable" is replaced from almost everywhere but I think there is still one "writeable" word left in core/modules/simpletest/src/KernelTestBase.php file.
Regarding #70: Patch looks good to me. No occurrence of "writeable" word in the core documentation.
Comment #75
markdorisonFixed remaining outstanding instance mentioned in #74.
Comment #76
daffie CreditAttribution: daffie commentedThe by @xjm requested followup still needs to be created.
Comment #77
markdorisonCreated followup issue as requested by xjm in #59: #3138595: Deprecate PhpStorage ::writeable() methods for removal in Drupal 11 with no replacement
Comment #78
daffie CreditAttribution: daffie commentedAll occurrences of "writeable" in comments have been changed.
Did a code search for all for current branches of core.
All code changes in both patches look good.
The requested followup is created.
For me it is RTBC.
Comment #79
jungleAdding this as a child issue of #3122088: [Meta] Remove spelling errors from dictionary.txt and fix them and it's postponed on #2972224: Add .cspell.json to automate spellchecking in Drupal core right now.
Comment #80
alexpottOnce #2972224: Add .cspell.json to automate spellchecking in Drupal core is in we can add writeable to the flag words and fix this once and for all.
Comment #82
Swapnil_Kotwal CreditAttribution: Swapnil_Kotwal at Asentech LLC commentedApplied patch. All occurrences of "writeable" in comments are changed. Kindly review
Comment #83
pavnish CreditAttribution: pavnish at Srijan | A Material+ Company for Drupal India Association commented@Swapnil_Kotwal Please add the interdiff it's very helpful for reviewer to identify what new changes added in patch.
Comment #85
rajandro CreditAttribution: rajandro as a volunteer and at Srijan | A Material+ Company for Drupal India Association commentedThe last submitted patch 2898947-77.patch is not applicable for 8.9.x (and 9.1.x as well). Need to check, I am working on it.
Comment #86
rajandro CreditAttribution: rajandro as a volunteer and at Srijan | A Material+ Company for Drupal India Association commentedAfter reading all the comments, I have come with two versions of patches as per the comment number of #9, #31, #40, #41, #52 and then #53
2898947-86--writeable-to-writable-8.9.x => applied successfully for both 8.8.x and 8.9.x
2898947-86--writeable-to-writable-9.1.x => applied successfully for both 9.0.x and 9.1.x
And an important point to note, this is the changes from writeable to writable of core excluding the 3 core function name as mentioned in the scope
Thanks
Rajandro
Comment #87
rajandro CreditAttribution: rajandro as a volunteer and at Srijan | A Material+ Company for Drupal India Association commentedExpected test case failure due to change on
* @covers ::writeable
, Now adding the patch without that two changes.Thanks
Rajandro
Comment #88
rajandro CreditAttribution: rajandro as a volunteer and at Srijan | A Material+ Company for Drupal India Association commentedMoving this to NR with the interdiff of #86 and #87, Please review it.
Thanks
Rajandro
Comment #89
jungle$requirements["$file file writeable"]
should not be changed per @xjm's comment in #59core/misc/cspell/dictionary.txt
should be updated. As this is a tiny change, i will upload a new patch for 9.1.x and setting to RTBC.Comment #90
jungleChanging the target branch to 9.1.x
Comment #91
jungleFiled a follow-up #3155345: Change "writeable" in PhpStorage component to "writable"
Q: How to proper changing
writeable
in$requirements["$file file writeable"]
towritable
?Comment #92
alexpott@jungle I don't understand why the dictionary is being updated here. We can add writeable to the flagwords because we've nt removed it. That's something that'll only be possible in Drupal 10. If you feel #87 is rtbc without the dictionary change can you re-upload that one so that it is the latest patch on the issue.
Comment #93
jungleRe #92
After running “spellcheck:make-drupal-dict” to check typos and to re-generate the dictionary at the same time as you can see that two words are removed. I have n't touched "writeable"/"writable" here. This is why I updated the dictionary. If you think the change is unnecessary still, I will re-upload the patch in #87.
writeable
still exists in the codebase, not sure if we should add it into flagwords hereThanks!
Comment #94
jungleWell, re-uploading the patches in #87, the change to the directory in #89 is out of scope here.
Comment #95
alexpottWe also need a follow-up for changing $requirements["$file file writeable"] - as a render array this can change in a minor but needs it's own issue and maybe a CR. I created #3155400: Change $requirements["$file file writeable"] to $requirements["$file file writable"]
Comment #96
alexpott@codersukanta thanks for applying the patch and searching the code base. In these instances screenshots are not that helpful and look more like an attempt to game issue credit. An alternative approach would have been to provide an interdif.
I've tried to credit everyone who made conttributions to the discussions and helped manage the issue towards a reasonable scope and conclusion.
Committed and pushed a0a8601936 to 9.1.x and d2734732e7 to 9.0.x. Thanks!
Committed 9e9e25b770 and pushed to 8.9.x. Thanks!
Backported to 8.9.x and 9.0.x since this is only changing documentation.
Comment #98
alexpott