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
#2178795: Allow DiscoveryInterface::getDefinition() to throw an exception for an invalid plugin had to change a test when it really should not have needed to. (See comment #70 1.)
+++ b/core/modules/field_ui/lib/Drupal/field_ui/Tests/ManageFieldsTest.php
@@ -112,7 +112,7 @@ function manageFieldsPage($type = '') {
- $this->assertIdentical("$url/delete", (string) $result[2]['href']);
+ $this->assertIdentical("$url/delete", (string) $result[3]['href']);
Beta phase evaluation
Issue category | Bug because test is accidentally testing something it should not |
---|---|
Issue priority | Minor (or Normal) since this is very isolated per https://www.drupal.org/core/issue-priority |
Unfrozen changes | Unfrozen because it only changes automated tests |
So this is allowed in the beta since it is only effecting an automated test.
Proposed resolution
change the test to not explicitly depend on absolute values of indexes.
Remaining tasks
- Investigate if the order test should simple see if some operation is at the end, or ... is greater/less than another.
- (done) git instructions for creating patch | Contributor task documentation for creating a patch
Task | Novice task? | Contributor instructions | Complete? |
---|---|---|---|
Reroll the patch if it no longer applies. | Instructions | ||
Review patch to ensure that it fixes the issue, stays within scope, is properly documented, and follows coding standards | Instructions |
User interface changes
No.
API changes
No.
Comment | File | Size | Author |
---|---|---|---|
#25 | 2269033-25.patch | 1.54 KB | rpayanm |
#25 | 2269033-interdiff.txt | 1.48 KB | rpayanm |
#22 | 2269033-22.patch | 1.46 KB | zaporylie |
#22 | interdiff-2269033-18-22.txt | 976 bytes | zaporylie |
#18 | 2269033-18.patch | 1.46 KB | charginghawk |
Comments
Comment #1
lieb CreditAttribution: lieb commentedNew contributor - looking into this.
Comment #2
lieb CreditAttribution: lieb commentedFile in question is now in ./core/modules/field_ui/src/Tests/
Comment #3
lieb CreditAttribution: lieb commentedComment #4
lieb CreditAttribution: lieb commentedComment #5
lieb CreditAttribution: lieb commentedOkay, the patch passed but it is logically incorrect. With this patch it is possible for these 3 assertions to not run at all. the correct solution is to find a way to index the array on some static value. I will keep working on this.
Comment #6
BerdirComment #7
lorique CreditAttribution: lorique commentedI reviewed this, and logically it looks fine. Not sure if we're covering all the cases.
I ran tests with:
php core/scripts/run-tests.sh --class "Drupal\field_ui\Tests\ManageFieldsTest"
And got the following error:
I don't know if this is related, but its the same file. I'm setting this issue back to needs work.
Comment #8
swentel CreditAttribution: swentel commentedAdded an additional test because if we change the label on the links by accident, the test won't cover it.
Comment #9
YesCT CreditAttribution: YesCT commenteddoing https://www.drupal.org/contributor-tasks/update-allowed-beta
to evaluate https://www.drupal.org/contribute/core/beta-changes
Comment #10
rpayanmrerolled...
Comment #14
zaporylieI will re-roll #10
Comment #15
zaporylieHere is re-rolled patch #10, with additional
break;
at the and ofcase 'Delete instance.':
Comment #17
charginghawk CreditAttribution: charginghawk commentedComment #18
charginghawk CreditAttribution: charginghawk commentedThe error is due to the fact that 'Edit field settings' was changed to 'Edit storage settings' in issue 2312093:
https://www.drupal.org/node/2312093
https://github.com/drupal/drupal/commit/1476c56c62e4d84ef3e9a57029a92b1f...
Re-rolling with that minor change.
Comment #20
manningpete CreditAttribution: manningpete commentedLast patch applies; no reroll needed.
Comment #21
zaporylieComment #22
zaporylieGood work @charginghawk! Thanks to you I discovered that all dropdown menu titles was changed in #2312093: Rename FieldInstanceConfig to FieldConfig. I've updated patch - should be ok right now.
Comment #23
swentel CreditAttribution: swentel commentedGood to go
Comment #24
alexpottRather than the variable name of $result / $res how about $operation_links / $link
Comment #25
rpayanmHere the patch.
Comment #26
zaporylie#25 follows alexpott suggestion, nothing more, so I'm bumping it back to RTBC.
Comment #27
webchickLooks good!
Committed and pushed to 8.0.x. Thanks!