Problem/Motivation

In Drupal10, the URL to edit file field details has changed slightly,
From:
admin/structure/types/manage/[nodeType]/fields/node.[nodeType].[fieldName]/storage
To:
admin/structure/types/manage/[nodeType]/fields/node.[nodeType].[fieldName]

Because of that URL change, the automated test suite now produces several related failures.

Additionally, the t() function returns a TranslateableMarkup object instead of a string, which causes many failures in the test suite. Since these tests are not for the translation service, they should be removed (following the lead of the Address module on this).

Steps to reproduce

Install the module on a fresh D10 site and run the automated test suite.

Proposed resolution

Attached patch changes the URL for file field edit details, and removes t() from tests where it causes errors. It also updates the submit button text to match current text in core, as well as adjusts the field identifiers where needed.

CommentFileSizeAuthor
#2 3442719-test-love.patch3.7 KBrschwab
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

rschwab created an issue. See original summary.

rschwab’s picture

Status: Active » Needs review
StatusFileSize
new3.7 KB
rschwab’s picture

Issue summary: View changes
gnuget’s picture

Status: Needs review » Needs work

Hi @rschwab.

It seems that your patch cannot be applied using the dev version of the module.

 git apply -v --index 3442719-test-love.patch
Checking patch tests/src/Functional/EmptyValuesTest.php...
error: tests/src/Functional/EmptyValuesTest.php: does not match index
Checking patch tests/src/Functional/FileFieldSourcesTestBase.php...
error: tests/src/Functional/FileFieldSourcesTestBase.php: does not match index
Checking patch tests/src/Functional/MultipleValuesTest.php...
error: tests/src/Functional/MultipleValuesTest.php: does not match index

Not sure why.

rschwab’s picture

I'm not sure why either. It works for me on a fresh pull:

me@local:~/repos/filefield9/web/modules$  git clone --branch '2.0.x' https://git.drupalcode.org/project/filefield_sources.git
Cloning into 'filefield_sources'...
remote: Enumerating objects: 1797, done.
remote: Counting objects: 100% (64/64), done.
remote: Compressing objects: 100% (45/45), done.
remote: Total 1797 (delta 16), reused 52 (delta 12), pack-reused 1733
Receiving objects: 100% (1797/1797), 376.69 KiB | 2.77 MiB/s, done.
Resolving deltas: 100% (1171/1171), done.
me@local:~/repos/filefield9/web/modules$ cd filefield_sources/
me@local:~/repos/filefield9/web/modules/filefield_sources$ git apply -v --index 3442719-test-love.patch
Checking patch tests/src/Functional/EmptyValuesTest.php...
Checking patch tests/src/Functional/FileFieldSourcesTestBase.php...
Checking patch tests/src/Functional/MultipleValuesTest.php...
Applied patch tests/src/Functional/EmptyValuesTest.php cleanly.
Applied patch tests/src/Functional/FileFieldSourcesTestBase.php cleanly.
Applied patch tests/src/Functional/MultipleValuesTest.php cleanly.

gnuget’s picture

I create a merge request because the DrupalCi does not allow me to see the console output anymore, and it is hard to check why it is failing.

Here the pipeline, it seems that some tests are still failing, those are expected to fail or with your current patch all the tests should pass?
https://git.drupalcode.org/project/filefield_sources/-/jobs/1423706

David.

  • gnuget committed 3905bb00 on 2.0.x
    Issue #3442719 by gnuget, rschwab: Test updates for D10 field edit form
    
gnuget’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

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