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

  • backreference
  • entityreference
  • nodereference
  • referenceable
  • referenceables
  • referencer
  • referencers

Review

User interface changes

API changes

Data model changes

Release notes snippet

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quietone created an issue. See original summary.

quietone’s picture

Status: Active » Needs review
FileSize
11.99 KB

This does backreference, entityreference and nodereference.

samiullah’s picture

@quietone Looks good
Do we have separate ticket for other words related to reference

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

Issue summary: View changes
FileSize
1.75 KB
11.49 KB

Needed a reroll because of [#2e80fc24678]

@samiullah, no all the words containing 'reference' are listed in the IS.

Abhijith S’s picture

Patch #5 applies cleanly on on 9.2.x.

after

jungle’s picture

$ yarn spellcheck:core
yarn run v1.22.4
$ cspell "**/*" ".*" "../composer/**/*" "../composer.json"
core/modules/migrate_drupal/src/Plugin/migrate/field/d6/NodeReference.php:11:12 - Unknown word (nodereference)
core/modules/migrate_drupal/src/Plugin/migrate/field/d6/NodeReference.php:14:9 - Unknown word (nodereference)
core/modules/migrate_drupal/src/Plugin/migrate/field/d6/NodeReference.php:16:23 - Unknown word (nodereference)
core/modules/migrate_drupal/tests/src/Unit/Plugin/migrate/field/d6/NodeReferenceFieldTest.php:37:44 - Unknown word (nodereference)
CSpell: Files checked: 15135, Issues found: 4 in 2 files

Fixing.

longwave’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me.

catch’s picture

+++ b/core/misc/cspell/dictionary.txt
@@ -120,7 +120,6 @@ backend's
 backlinks
 backport
-backreferences
 backtraces
 bakeware
 bangpow
@@ -521,7 +520,6 @@ enoki

@@ -521,7 +520,6 @@ enoki
 enregistrer
 entit
 entitynodeedit
-entityreference
 entitytype
 entityviewedit
 entrypoint
@@ -1047,7 +1045,6 @@ nocookie

@@ -1047,7 +1045,6 @@ nocookie
 nocssjs
 nodeaccess
 nodelink
-nodereference
 nodo

To 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).

jungle’s picture

If so, this is a won't fix.

quietone’s picture

All 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.

  • The term userreference from the D6 reference module has already been removed from the dictionary. This patch includes removing the companion term nodereference. I would prefer we be consistent, that is keep or remove both from the dictionary.
  • entityreference refers to the D7 module machine name and there are other pre-Drupal8 module machine names have been removed, like imagefield.

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'.

Matroskeen’s picture

Issue summary: View changes

Fixed broken list item in the task description.

catch’s picture

All but one of the changes here are migrate related and refer to term used in Drupal 6 and/or Drupal 7.

So 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.

+++ b/core/modules/views/src/Plugin/views/query/Sql.php
@@ -337,8 +337,8 @@ public function submitOptionsForm(&$form, FormStateInterface $form_state) {
    * relationship.
    *
-   * An example of a relationship would be a nodereference table.
-   * If you have a nodereference named 'book_parent' which links to a
+   * An example of a relationship would be a node reference table.
+   * If you have a node reference named 'book_parent' which links to a

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.

longwave’s picture

Based 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?

jungle’s picture

Won't fix +1, no need to revert userreference to be consistent to me, I think userreference is rarely used in Drupal 8/9.

quietone’s picture

FileSize
8.07 KB

I 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?

jungle’s picture

userreference
entityreferrence
...

I 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.

how do we identify words in the dictionary that are to stay in the dictionary?

A good question to continue.

My 2 cents: the fewer words stay in the dictionary, the better.

Can we have a section in the dictionary for words that are not to be changed and perhaps the reason?

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.

catch’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/modules/field/migrations/state/field.migrate_drupal.yml
@@ -1,3 +1,4 @@
+# cspell:ignore entityreference

This shouldn't be needed any more given it's staying in the dictionary.

jungle’s picture

Status: Needs work » Needs review
FileSize
624 bytes
7.69 KB

Rerolled and addressing #18 thanks!

jungle’s picture

Status: Needs review » Reviewed & tested by the community

Setting back to RTBC

  • catch committed e92a408 on 9.2.x
    Issue #3162822 by quietone, jungle, Abhijith S, catch, longwave: Fix...
catch’s picture

Status: Reviewed & tested by the community » Fixed

So 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!

Status: Fixed » Closed (fixed)

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