Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
In #3160031: Fix 18 spelling errors for migrate specific terms an attempt was made to fix references to nodereference but some were not part of the migration system. This issue is to preserve that work and to expand the scope to other words using 'reference'.
Possible words:
- backreference
- entityreference
- nodereference
- referenceable
- referenceables
- referencer
- referencers
Proposed resolution
Remaining tasks
Fix spelling for
backreferenceentityreferencenodereference- referenceable
- referenceables
- referencer
- referencers
Review
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#19 | 3162822-19.patch | 7.69 KB | jungle |
#19 | raw-interdiff-16-19.txt | 624 bytes | jungle |
Comments
Comment #2
quietone CreditAttribution: quietone as a volunteer commentedThis does backreference, entityreference and nodereference.
Comment #3
samiullah CreditAttribution: samiullah at Salsa Digital commented@quietone Looks good
Do we have separate ticket for other words related to reference
Comment #5
quietone CreditAttribution: quietone as a volunteer commentedNeeded a reroll because of [#2e80fc24678]
@samiullah, no all the words containing 'reference' are listed in the IS.
Comment #6
Abhijith S CreditAttribution: Abhijith S as a volunteer and at Zyxware Technologies commentedPatch #5 applies cleanly on on 9.2.x.
Comment #7
jungleFixing.
Comment #8
longwaveLooks good to me.
Comment #9
catchTo be honest I feel like all three of these words are fine to have in the dictionary.
backreference is a real technical term that's in common usage. nodereference and entityreference feel like Drupal neologisms rather than typos (and as the patch shows they're used several times).
Comment #10
jungleIf so, this is a won't fix.
Comment #11
quietone CreditAttribution: quietone as a volunteer commentedAll but one of the changes here are migrate related and refer to term used in Drupal 6 and/or Drupal 7. The exception is /core/modules/views/src/Plugin/views/query/Sql.php.
Back references is more a challenge, as it is not used consistently. Doing `man grep` for Debian 10 has a header of 'Back references' and then in the text there is 'back-reference'. The PhpManual uses two words, 'back reference'.
Comment #12
MatroskeenFixed broken list item in the task description.
Comment #13
catchSo for me if we're having to
cspell: ignore
a word in multiple different non-test files then it shows it's a word that we actually use. When we eventually drop support for migrating from Drupal 7, all those usages will be removed, and it'll be an unused word in the dictionary.This is the main usage of nodereference that's outside of migrate, but I wonder if the example itself is outdated now.
Leaving RTBC because I'm not sure what the right approach is here, still getting used to cspell but this is definitely borderline for me.
Comment #14
longwaveBased on #9-13 I am leaning towards "won't fix" for this most of this now.
"nodereference" and "entityreference" are Drupalisms and those are OK to have in the dictionary; we will always have some words that are special to this project. In conjunction with #11 I am tempted to suggest we put "userreference" back in the dictionary for consistency.
"backreference" is citable as a real word in the context of regular expressions, so I think this is OK too: https://en.wiktionary.org/wiki/backreference. Alternatively it only appears in two comments and "back reference" is just as understandable, so we could just fix these here?
Comment #15
jungleWon't fix +1, no need to revert
userreference
to be consistent to me, I thinkuserreference
is rarely used in Drupal 8/9.Comment #16
quietone CreditAttribution: quietone as a volunteer commentedI don't think the decision should be based on how often a word is used. The idea of identifying Drupalisms makes sense to me so I would prefer to explore and use that. And if I understand #13 then words from all versions of Drupal are valid words to keep in the dictionary.
I like consistency so I made a patch as suggested in #14, restored userreference and kept two changes other changes that (Sql.php and views.api.php). Patch attached, be warned I did it quickly.
But that raises the question for me - how do we identify words in the dictionary that are to stay in the dictionary? Can we have a section in the dictionary for words that are not to be changed and perhaps the reason?
And what happens to the words imagefield, imagelink, imageapi, imagemagick, optionwidgets and possibly more. These are already in cspell ignore lines.
Oh, another thought is how to ensure that 'backreference' is used and not 'back reference' or does that not matter?
Comment #17
jungleI think those are historical legacies and could/should be avoided at the beginning by adding
_
. They do not have to be Drupalized words. Unlike Druplicon, drush, nid etc, which are true new words in the Drupal land.A good question to continue.
My 2 cents: the fewer words stay in the dictionary, the better.
misc/cspell/dictionary.txt is generated automatically, comments are not allowed AFAIK. #3153919: Rename dictionary.txt file to drupal.dic to make it compatible with PhpStorm on Linux here adopted an approach having two dictionaries, -- adding a permanent dictionary for those words is possible, but ideally, one dictionary is better.
Comment #18
catchThis shouldn't be needed any more given it's staying in the dictionary.
Comment #19
jungleRerolled and addressing #18 thanks!
Comment #20
jungleSetting back to RTBC
Comment #22
catchSo I think the ideal thing would be if migrate (or any other component) was able to add it's own dictionary.txt, which would be cumulatively combined with core's - however that's not really a feature of cspell. As it stands, to me it makes sense to keep these in the dictionary, then when the code is removed, they can be removed too. But having to cspell-ignore the same terms, which we're intentionally using, over and over again doesn't seem great.
Committed/pushed to 9.2.x, thanks!