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
Image effect help text showing when an effect is edited currently has no test coverage.
Proposed resolution
Add test coverage
Remaining tasks
Task | Novice task? | Contributor instructions | Complete? |
---|---|---|---|
Create a patch | Novice | Instructions | X |
Add automated tests | Novice | Instructions | X |
Manually test the patch | Novice | Instructions | X |
Review patch to ensure that it fixes the issue, stays within scope, is properly documented, and follows coding standards | Instructions | X | |
Commit to Drupal 8 | X | ||
Commit to Drupal 7 | X | ||
Port automated tests from D7 to D8 |
Original report by @rlhawk
The help text for an image effect appears when the effect is added to an image style, but not when the effect is edited.
Comment | File | Size | Author |
---|---|---|---|
#88 | 1737714-nr-bot.txt | 2.37 KB | needs-review-queue-bot |
Issue fork drupal-1737714
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
Comment #1
rlhawkThe attached patch fixes the bug so that the help text for image effects displays when the effect is edited.
Comment #2
rlhawkHere's a new patch for Drupal 8.
Comment #3
claudiu.cristeaI manually tested and is fixed now in D8. Moving back to D7.
Comment #4
dcam CreditAttribution: dcam commentedWe'll need to add an automated test for this. See the instructions for adding automated tests.
Also, I haven't looked into the code, but I'm guessing the other $arg[] indexes in the line changed by the patch will also need to be updated.
Comment #5
darol100 CreditAttribution: darol100 as a volunteer and commentedThis patch is out-dated. Needs re-roll.
Comment #6
legovaerI'm currently working on the automated tests for this regression.
Comment #7
legovaerThis patch contains the automated tests for this issue.
Comment #8
legovaerHere's a new patch for D7.
Comment #9
legovaerComment #11
legovaerAdded patch that contains both the automated tests + the patch that will fix the issue.
Comment #12
rlhawkI tested the patch and it fixes the issue. The tests work great.
Comment #13
David_Rothstein CreditAttribution: David_Rothstein as a volunteer commentedCommitted to 7.x - thanks!
Fixed a lot of small things in the tests on commit:
Comment #15
darol100 CreditAttribution: darol100 as a volunteer and commented@David_Rothstein,
Does this applies also to D8 ? Should we move this issue into a D8 version ?
Comment #16
David_Rothstein CreditAttribution: David_Rothstein as a volunteer commentedActually those tests look pretty nice and I doubt there's any tests like that in Drupal 8 now, so it would be good to forward-port them.
Comment #17
David_Rothstein CreditAttribution: David_Rothstein as a volunteer commentedOh, I guess I cross-posted :) Based on earlier comments and what I see in the admin UI, the bug itself doesn't affect Drupal 8, so just the tests would be needed.
Comment #18
darol100 CreditAttribution: darol100 as a volunteer and commented@David_Rothstein, only the test or the entire patch ?
Comment #19
David_Rothstein CreditAttribution: David_Rothstein as a volunteer commentedJust the tests... but if they fail because I'm wrong, then the entire patch :)
Comment #20
r.nabiullin CreditAttribution: r.nabiullin at Skilld commentedComment #21
therealssj CreditAttribution: therealssj commentedPatch ported for 8.0.x, but seems to fail as it is not loading the help text.
The issue doesn't affect 8.0.x but the help text is not displayed when running tests.
Comment #22
gvsoThis may help going further in the test
Comment #23
gvsoJust added documentation to
public static $modules = array('help', 'block', 'system');
Comment #24
gvsoComment #27
vsawant CreditAttribution: vsawant commentedThe new development version is 8.2
Comment #28
zipymonkey CreditAttribution: zipymonkey commentedPatch could not be applied to 8.2.x branch. Rerolling the patch for 8.2.x.
Comment #29
dcam CreditAttribution: dcam commentedI think that we can apply this against 8.1.x. Check out the Allowed changes during the Drupal 8 release cycle. There's nothing specifically in that document about this case, probably because it's unusual to be forward-porting anything. It's a non-disruptive change though. We're not even fixing a bug here, much less changing an API or altering the UI. If anything, it would be helpful to include these tests in the earliest minor version possible to help ensure its stability moving forward.
#28 applies to 8.1.x so there's no reason to set the status to Needs Work.
Comment #30
dcam CreditAttribution: dcam commentedI did a code review of this #28 and found a few problems. A new patch needs to be rolled with the following changes.
The final comma and space inside the list() call can be deleted.
There's a typo in this comment.
The assert message needs to be edited, "...on the edit effect page."
Otherwise, the patch looks good and I'd RTBC it.
Comment #31
afem CreditAttribution: afem as a volunteer commentedI applied the changes from #30.
Comment #32
zipymonkey CreditAttribution: zipymonkey commentedPatch in #31 apply fine for me on 8.1.x branch. Looks good to me.
Comment #33
dcam CreditAttribution: dcam commented#31 is RTBC. The problems that I mentioned in #30 have been corrected. The tests are functionally the same as those that were committed to D7.
Good work today in NOLA @afemath and @zipymonkey!
Comment #35
zipymonkey CreditAttribution: zipymonkey commentedReran the test on parch #31 since the failure was to be in core/modules/migrate_drupal_ui/src/Tests/MigrateUpgradeTestBase.php. It passed this time so I'm changing this back to RTBC.
Thanks for the help @dcam and @afemath.
Comment #36
alexpottIf we're introducing a new helper to create an ImageStyle object I think we should behave like the other test entity creators and return the created entity. ie. this should just return the $style object and then the tests can call ->id(), ->label() and ->url(). Doing list() on the return looks unnecessarily magic.
Comment #40
pk188 CreditAttribution: pk188 at OpenSense Labs commentedRe rolled #28. Fixed #30.
Comment #42
pk188 CreditAttribution: pk188 at OpenSense Labs commentedComment #47
Rithesh BK CreditAttribution: Rithesh BK as a volunteer and at Valuebound for Valuebound commentedcurrently i am working on it ......
Comment #48
Rithesh BK CreditAttribution: Rithesh BK as a volunteer and at Valuebound for Valuebound commentedcurrently checking the issue ......
Comment #49
Rithesh BK CreditAttribution: Rithesh BK as a volunteer and at Valuebound for Valuebound commentedImage effect help text is displaying when an effect is edited for drupal version 8.6.x-dev. Hence it is fixed. Please find the attached screenshot ....
Comment #50
dhirendra.mishra CreditAttribution: dhirendra.mishra at Valuebound for Valuebound commentedLet Creator of this issue to mark "closed status".
Comment #51
rlhawkThe remaining task in this issue is to forward-port to D8 the image effect tests that were added to D7. I'll update the issue description to reflect that.
Comment #52
rlhawkComment #54
narendra.rajwar27Comment #55
narendra.rajwar27Comment #57
vsujeetkumar CreditAttribution: vsujeetkumar at Srijan | A Material+ Company for Drupal India Association commentedRe-roll patch given for 8.9.x.
Comment #59
vsujeetkumar CreditAttribution: vsujeetkumar at Srijan | A Material+ Company for Drupal India Association commentedFixed the tests.
Comment #61
vsujeetkumar CreditAttribution: vsujeetkumar at Srijan | A Material+ Company for Drupal India Association commentedFixed fail test.
Comment #62
mondrakeCertainly this will not get in 8.9. Bumping to 9.3.
Comment #63
vsujeetkumar CreditAttribution: vsujeetkumar at Srijan | A Material+ Company for Drupal India Association commentedRe-roll patch given for 9.3.x.
Comment #64
vsujeetkumar CreditAttribution: vsujeetkumar at Srijan | A Material+ Company for Drupal India Association commentedFixed the CSpell issue.
Comment #65
mondrakeOh... a Simpletest test! This is not executed any more, actually. To be converted to a Functional test.
:void
return typehintassertText()
is deprecated:void
return typehintdrupalPostForm()
is deprecatedassertText()
is deprecatedNeeds a return typehint
Do we really need to return an array? Maybe this would do in D7, but now we should be able to retrieve the style's name and Url from the object itself?
Comment #66
vsujeetkumar CreditAttribution: vsujeetkumar at Srijan | A Material+ Company for Drupal India Association commentedWorked on #65:
#65.1: Converted to functional test.
#65.2: :void typehint added.
#65.3: Fixed.
#65.4: :void typehint added.
#65.5: Fixed.
#65.6: Fixed.
#65.7: :array typehint added.
#65.8: Pending.
Comment #67
mondrakeThere's no need to wrap the string in
t()
here, we are not testing translations.just return
$style
. Then in calling code, the style name would be$style->getName()
, and the path$style->toUrl()
or even$style->toUrl()->toString()
.Comment #68
dhirendra.mishra CreditAttribution: dhirendra.mishra at Valuebound for Valuebound commentedLet me work on this
Comment #69
mondrakeThis is test only code, so removing irrelevant tag
Comment #70
vsujeetkumar CreditAttribution: vsujeetkumar at Srijan | A Material+ Company for Drupal India Association commentedWorked on #67, Please have a look.
Comment #74
LendudeUpdated the title a bit, to be more in line with the patch.
This should now be 'stark' I guess
We should check that $effects isn't empty (or size 1, since we added one effect earlier), because if it is empty, this will still pass
Comment #77
rpayanmPlease review.
Comment #78
rpayanmComment #80
smustgrave CreditAttribution: smustgrave at Mobomo commentedReviewing MR 3270
Removing credit for myself as I just rebased to make sure the tests passed.
The changes requested in #74 have been addressed
All new functions have a return typehint.
Comment #81
xjmThanks for working on this issue! A few points:
In general, Drupal has moved away from creating random fixture data, since it can cause all sorts of random failures and obscure what is actually being tested. We're better off having a fixed value (or data provider of values covering edgecases). I can see the value of having a helper method to save a new image style, but I think it should probably take the style name and label as parameters rather than being random.
Also, we should almost never typehint a generic
object
. Surely there's an interface for image styles?That would be a really big test...
I think this is supposed to be "Tests the image style administration UI" or something along those lines.
Nit: "Tests that..."
Also, are these two docblocks supposed to be identical? Seems like they should be different.
I don't think we need the use of
t()
here.Comment #82
xjmI just realized this issue has both patches and an MR, so I was reviewing the wrong thing. Most of my feedback still applies, though.
Hiding the patches, but please apply the above feedback to the MR. Thanks!
Comment #83
rpayanmI made the xjm's suggestions, please review.
Comment #84
smustgrave CreditAttribution: smustgrave at Mobomo commentedPoints from #81 have been addressed.
Comment #85
quietone CreditAttribution: quietone at PreviousNext commentedSee the comments in the MR.
Comment #86
quietone CreditAttribution: quietone at PreviousNext commentedIt has been two years since @dhirendra.mishra worked on this, so un-asssinging.
Comment #87
rpayanmI made the @quietone's suggestions.
Comment #88
needs-review-queue-bot CreditAttribution: needs-review-queue-bot as a volunteer commentedThe Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #90
sourabhjainComment #91
smustgrave CreditAttribution: smustgrave at Mobomo commentedStill appears to have one open thread.
Comment #92
rpayanmComment #93
smustgrave CreditAttribution: smustgrave at Mobomo commentedSeems MR has some kind of failure.
Comment #95
royalpinto007Comment #96
royalpinto007Comment #98
sahil.goyal CreditAttribution: sahil.goyal as a volunteer and at Srijan | A Material+ Company for Drupal India Association commentedMoving to Needs Review.
Comment #99
smustgrave CreditAttribution: smustgrave at Mobomo commentedI think this could probably be a kernel test no? Does it need a full bootstrap for testing a message? If it remains a functional still don't think it needs to be it's own.
Comment #101
acbramley CreditAttribution: acbramley at PreviousNext for Service NSW commentedMade some minor updates and left a few comments. I think this is fine as a functional test as the issue is about help text appearing on specific routes.
Keeping as NW because I feel like there are some changes that are out of scope here.