- Issue created by @kim.pepper
- First commit to issue fork.
- ๐ง๐ทBrazil elber Brazil
Hi @kim.pepper should I move everything to a trait?
- First commit to issue fork.
- ๐บ๐ธUnited States ultimike Florida, USA
I plan on working on this issue with my team.
-mike
- ๐ฌ๐งUnited Kingdom jacobupal Leeds
We're working on this in our contrib table.
- ๐ฌ๐งUnited Kingdom jacobupal Leeds
^^ Not anymore, our bad @ultimike! We thought the 'team' meant the whole mentoring team & newbies. Good luck!
- First commit to issue fork.
- ๐น๐ณTunisia drubolbol
@nico059 and me have created a new file FileTestFormBase.php with the main common code for buildForm function that is extented by the other classes in the other files.
- Merge request !9644Create a Base class to mutualise common code between FiletTestForm.php and... โ (Closed) created by nico059
- ๐บ๐ธUnited States ultimike Florida, USA
@drubolbol and @nico059 did a great job during the DrupalCon Barcelona mentored core contribution day - making good progress on this issue (and learning a lot about the contribution process along the way.)
Currently, it appears that the changes have caused some tests to fail:
- Drupal\Tests\file\Functional\SaveUploadTest
- Drupal\Tests\file\Functional\SaveUploadFormTest
- Drupal\Tests\file\Functional\RemoteFileSaveUploadTest
See https://git.drupalcode.org/issue/drupal-3368857/-/pipelines/294400 for more details.
-mike
- ๐ซ๐ทFrance mattlc
I tried to replace the abstract class by a trait in order to keep original class inheritance/interface implementation intact but the tests results are the same : the "Submit" button cannot be found by #14 stated failing tests.
- ๐จ๐ฆCanada nico059
Dear all,
I try also with Trait, and it work's but .... I think the problem with the 3 failed Test is "somewhere else" in the issue fork code. And NOT in the code done here to resolve this issue ...
What I have done ...
I modify the 3 files in repos/drupal/core/modules/file/tests/file_test/src/Form to use a new Trait:
- FileTestForm.php --> to use the Trait
- FileTestSaveUploadFromForm.php --> to use the Trait
- FileTestFormTrait.php --> the Trait itself
I have created a branch with this code here : https://git.drupalcode.org/issue/drupal-3368857/-/tree/3368857-remove-du...Tests Works BUT ....
The following tests works:
Drupal\Tests\file\Functional\SaveUploadTest
Drupal\Tests\file\Functional\SaveUploadFormTest
Drupal\Tests\file\Functional\RemoteFileSaveUploadTest
BUT .... only if I test them a more recent issue fork
FYI, as I don't know HOW TO DEV in the latest 11.x Drupal version.... I choose a random other fork more recent to test (I choose 3478771-inputconfigurator-should-expose), and when I run them all works !!Conclusion
I think something is "wrong" in the current issue fork (3368857) somewhere else
Perhaps is it possible to rebase ALL this issue fork with the latest core version ? And see if the Test works too ? - Merge request !9792Create a Base class to mutualise common code between FiletTestForm.php and... โ (Open) created by nico059
- ๐ซ๐ทFrance mattlc
mattlc โ changed the visibility of the branch 3368857-remove-duplication-trait-rebased to hidden.
- First commit to issue fork.
I have pushed code based on @ultimike and @nico059's approach using an abstract class and the tests appear to pass now. I'm assuming there were some random Functional test failures but they pass once I rerun the pipeline.
- ๐บ๐ธUnited States smustgrave
There are 3 MRs up but no clear indicator which should be reviewed. Also proposed solution section appears to be remaining tasks.
- ๐ซ๐ทFrance mattlc
Hello,
Thank you @anand48, as discussed with both @nico059 and @ultimike at DC Bacelona Trait might be a better solution to keep a simple extension hierarchy.
I worked on the 3368857-remove-duplication-trait.
- minor code style issues fix
- rebased on 11.x
- force pushed to 3368857-remove-duplication-traitSo I think the MR to consider is 9792 from @nico059.
I set the status to Needs review.
- ๐ซ๐ทFrance mattlc
Just saw this. My bad.
I rework on it.
Sorry for that. - ๐ซ๐ทFrance mattlc
mattlc โ changed the visibility of the branch 3368857-remove-duplication-from to hidden.
- ๐ซ๐ทFrance mattlc
mattlc โ changed the visibility of the branch 3368857-remove-duplication-from-form to hidden.
- ๐บ๐ธUnited States smustgrave
Issues seems resolved and trait seems good to me.
Closed the other 2 MRs
- ๐ณ๐ฟNew Zealand quietone
Thanks everyone for getting this to RTBC. There is just one thing, which I commented on in the MR. I know naming can be a challenge but I do think the method needs a better name.
- ๐ฎ๐ณIndia akulsaxena
Hi @quietone
I changed the name of the trait
FileTestFormTrait
tobaseForm
as instructed.
Please take a lookThanks
- Status changed to Needs work
5 days ago 4:16pm 28 November 2024 - ๐ฎ๐ณIndia ankitv18
Minor suggestion regarding the naming convention of trait class ~~ hence moving back to NW.
- ๐ฎ๐ณIndia akulsaxena
Hey @ankitv18,
Thanks for pointing out the mistake.
In #33, @quietone mentioned:I think we need a better name here, one that doesn't have 'trait' in a method name.
I changed the trait name while I should have just changed the method name. I undid the unnecessary changes and changed the method name as suggested.
Thanks
Please review it now. - ๐ฎ๐ณIndia akulsaxena
The pipeline was run after rebasing and tests are all green - no errors!
-
quietone โ
committed 7406530a on 11.1.x
Issue #3368857 by ultimike, nico059, mattlc, akulsaxena, anand48,...
-
quietone โ
committed 7406530a on 11.1.x
-
quietone โ
committed dd5c7b57 on 11.x
Issue #3368857 by ultimike, nico059, mattlc, akulsaxena, anand48,...
-
quietone โ
committed dd5c7b57 on 11.x
- ๐ณ๐ฟNew Zealand quietone
@akulsaxena, Welcome to Drupal!
Committed to 11.x and cherry-picked to 11.1.x
Thanks!