- 🇺🇸United States smustgrave
This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request → as a guide.
This will need a test case showing the issue.
- Status changed to Needs review
over 1 year ago 3:48pm 23 March 2023 - 🇫🇷France O'Briat Nantes
The test case is describe in "Steps to reproduce" in the description.
Since it occurs between the upload and the presave you either have to use xdebug or a hook (like hook_file_validate) that is triggered between this two events.
- Status changed to Needs work
over 1 year ago 4:22pm 23 March 2023 - 🇺🇸United States smustgrave
Then the test case can use a hook_file_validate. Would see if there are any test modules that could be leverage before creating a new one.
- Status changed to Needs review
over 1 year ago 2:11pm 12 April 2023 - 🇫🇷France O'Briat Nantes
I add a test in
\Drupal\Tests\file\Kernel\ValidatorTest::testFileValidateImageResolution
.Strange but in the test file
$this->image
has anull
size on creation.But I wonder if the root of the problem is not located in
\Drupal\system\Plugin\ImageToolkit\GDToolkit::save
which doesn't update the "this / Image" object filesize on save. - Status changed to RTBC
over 1 year ago 6:06pm 12 April 2023 - 🇺🇸United States smustgrave
Good job finding an existing test to tie into.
Ran the test without the fix locally and it correctly failed
Failed asserting that 174 matches expected null.
Expected :null
Actual :174Think this is good for committer review.
- 🇫🇷France O'Briat Nantes
How did you get the details response ?
When I run the test I just get a summary:$ ./vendor/bin/phpunit -c core core/modules/file/tests/src/Kernel/ValidatorTest.php --filter=testFileValidateImageResolution Tests: 1, Assertions: 16, Failures: 1.
It's a bit strange that the test file
$this->image
(core/misc/druplicon.png) has anull
size on creation instead of 3905. - 🇫🇷France O'Briat Nantes
OK, I resolve my interrogations:
First, in the test, file size has to be set on image object creation (I add it to the MR).
Second, the root cause of the problem is located here:
$image = $image_factory->get($file->getFileUri());
, there are now two different objects, an image one with the correct size set on save and a file one that is not updated after the image object modification. - last update
over 1 year ago 30,320 pass - last update
over 1 year ago 30,322 pass - last update
over 1 year ago 30,322 pass - last update
over 1 year ago 30,322 pass - last update
over 1 year ago 30,322 pass - last update
over 1 year ago 30,322 pass - last update
over 1 year ago 30,322 pass - last update
over 1 year ago 30,322 pass - last update
over 1 year ago 30,322 pass - last update
over 1 year ago 30,325 pass - last update
over 1 year ago 30,330 pass - last update
over 1 year ago 30,330 pass - last update
over 1 year ago 30,330 pass - last update
over 1 year ago 30,330 pass 0:02 56:21 Running- last update
over 1 year ago 30,334 pass - last update
over 1 year ago 30,334 pass - last update
over 1 year ago 30,334 pass - last update
over 1 year ago 30,334 pass - last update
over 1 year ago 30,334 pass - last update
over 1 year ago 30,334 pass - last update
over 1 year ago 30,335 pass - last update
over 1 year ago 30,335 pass - last update
over 1 year ago 30,335 pass - last update
over 1 year ago 30,335 pass - last update
over 1 year ago 30,335 pass - last update
over 1 year ago 30,338 pass - Status changed to Needs review
over 1 year ago 4:43pm 7 June 2023 - 🇺🇸United States Amber Himes Matz Portland, OR USA
Looks like the MR was updated after the last RTBC and needs another review. Thank you!
- Status changed to Needs work
over 1 year ago 9:35pm 7 June 2023 - 🇫🇷France O'Briat Nantes
oh, I thought a simple rebase will do the trick, but it seems a bit more complex to switch branch on MR.
Any help welcome - last update
over 1 year ago 30,338 pass - Merge request !4164Resolve #3292350 "Filevalidateimageresolution does not" → (Open) created by O'Briat
- last update
over 1 year ago 29,442 pass - last update
over 1 year ago 30,338 pass - 🇫🇷France O'Briat Nantes
Ok, I finally read the doc and found the "Create new branch" link: here's a new MR against 11.x.
- Status changed to Needs review
over 1 year ago 3:02pm 12 June 2023 - 🇫🇷France O'Briat Nantes
The two changes made since the last RTBC are :
- "Add filesize attribute on image object creation." in the file ValidatorTest setup: https://git.drupalcode.org/project/drupal/-/merge_requests/4164/diffs?co...
- a new MR against 11.x branch
- Status changed to RTBC
over 1 year ago 8:11pm 12 June 2023 - last update
over 1 year ago 30,337 pass, 2 fail - Status changed to Needs work
over 1 year ago 3:23pm 14 June 2023 - Status changed to RTBC
over 1 year ago 3:25pm 14 June 2023 - last update
over 1 year ago 30,341 pass - last update
over 1 year ago 30,341 pass - last update
over 1 year ago 30,341 pass 15:04 13:52 Running- last update
over 1 year ago 30,341 pass - last update
over 1 year ago 30,341 pass - last update
over 1 year ago 30,341 pass - last update
over 1 year ago 30,341 pass - last update
over 1 year ago 30,341 pass - last update
over 1 year ago 30,341 pass - last update
over 1 year ago 30,341 pass - last update
over 1 year ago 30,341 pass - last update
over 1 year ago 30,341 pass - last update
over 1 year ago 30,333 pass, 2 fail - last update
over 1 year ago 30,341 pass - last update
over 1 year ago 30,341 pass - last update
over 1 year ago 30,341 pass - last update
over 1 year ago 30,341 pass - last update
over 1 year ago 30,341 pass - last update
over 1 year ago 30,341 pass - last update
over 1 year ago 30,341 pass - last update
over 1 year ago 30,341 pass - last update
over 1 year ago 30,341 pass - last update
over 1 year ago 30,341 pass - last update
over 1 year ago 30,341 pass - last update
over 1 year ago 30,341 pass - Status changed to Needs work
over 1 year ago 5:46am 8 August 2023 - 🇳🇿New Zealand quietone
I am doing triage on the core RTBC queue → .
The issue summary is easy to follow. The remaining task is to add a new test? Has that been completed?
I looked at the latest MR and see that an assertion has been added. I am guessing that means a 'new test' has been added.
The MR needs to be updated. The diff does not apply locally to 11.x
@O'Briat, thanks for you work. There are instructions for rebasing an MR to a new base branch → on the wiki. I read your comment in #16 and think that would be helpful in the issue summary.
- last update
over 1 year ago 30,056 pass - last update
over 1 year ago 30,341 pass - Status changed to RTBC
over 1 year ago 9:50am 22 August 2023 - 🇫🇷France O'Briat Nantes
I updated the MR and fixed the description as the test was present.
Since no code has been change since the last RTCB (with test), I set it again to RTBC.
@quietone , thanks for the link. Do you know the workflow in order to propose a issue with MR on multiple core version? This MR could be apply 10.x (and 9.x but it not worth it)
- last update
over 1 year ago 30,056 pass - last update
over 1 year ago 30,058 pass - last update
over 1 year ago 30,060 pass - last update
over 1 year ago 30,063 pass - last update
over 1 year ago 30,129 pass, 2 fail - 🇳🇿New Zealand quietone
@O'Briat, thanks for making the changes! As a bug fix this is eligible for 11.x and 10.1.x. For 10.1.x you can create a patch or an MR.
- Open on Drupal.org →Environment: PHP 8.2 & MySQL 8last update
over 1 year ago Not currently mergeable. - @obriat opened merge request.
- Open on Drupal.org →Environment: PHP 8.2 & MySQL 8last update
over 1 year ago Not currently mergeable. - Open on Drupal.org →Environment: PHP 8.2 & MySQL 8last update
over 1 year ago Not currently mergeable. - @obriat opened merge request.
- Merge request !4689Resolve #3292350 "File validate image resolution 10.1.x" → (Open) created by O'Briat
- last update
over 1 year ago 29,470 pass - 🇫🇷France O'Briat Nantes
After struggling with an outdated 10.1.x branch on my fork, I hope I finally manage to port correctly my MR to the 10.1.x.
- last update
over 1 year ago 29,470 pass - Status changed to Needs work
over 1 year ago 6:02pm 4 September 2023 The Needs Review Queue Bot → tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide → to find step-by-step guides for working with issues.
- last update
over 1 year ago 29,471 pass - Open on Drupal.org →Environment: PHP 8.2 & MySQL 8last update
over 1 year ago Not currently mergeable. - last update
over 1 year ago 30,136 pass - Status changed to RTBC
over 1 year ago 10:00am 5 September 2023 - 🇫🇷France O'Briat Nantes
Replace the merge with a rebase for the 11.x MR to fix "needs-review-queue-bot" issue (and it's cleaner).
- last update
over 1 year ago 30,136 pass - last update
over 1 year ago 30,146 pass - last update
over 1 year ago 30,146 pass - last update
over 1 year ago 30,150 pass - last update
over 1 year ago 30,157 pass, 2 fail - last update
over 1 year ago 30,161 pass - last update
over 1 year ago 30,168 pass - last update
over 1 year ago 30,168 pass - last update
about 1 year ago 30,205 pass - last update
about 1 year ago 30,206 pass, 1 fail - last update
about 1 year ago 30,362 pass - last update
about 1 year ago 30,360 pass - last update
about 1 year ago 30,360 pass - last update
about 1 year ago 30,371 pass 45:02 43:48 Running- last update
about 1 year ago 30,382 pass - last update
about 1 year ago 30,384 pass - last update
about 1 year ago 30,392 pass, 1 fail - last update
about 1 year ago 30,397 pass - last update
about 1 year ago 30,410 pass - last update
about 1 year ago 30,415 pass - last update
about 1 year ago 30,420 pass - last update
about 1 year ago 30,426 pass - last update
about 1 year ago 30,434 pass - last update
about 1 year ago 30,438 pass - last update
about 1 year ago 30,456 pass - last update
about 1 year ago 30,472 pass - last update
about 1 year ago 30,483 pass - last update
about 1 year ago 30,486 pass - last update
about 1 year ago 30,486 pass - last update
about 1 year ago 30,488 pass - last update
about 1 year ago 30,511 pass - last update
about 1 year ago 30,519 pass - last update
about 1 year ago 30,524 pass, 2 fail - last update
about 1 year ago 30,552 pass - last update
about 1 year ago 30,574 pass - 🇸🇮Slovenia KlemenDEV
Ok, so I have figured out how to make a patch from the MR. I am attaching a patch for 10.1.x in case someone needs it.
- 🇸🇮Slovenia KlemenDEV
Doing tests with my patch for 1.10.x from comment #42, I can confirm it fixes the problem and works fine for me
- last update
about 1 year ago 30,603 pass - 🇫🇷France O'Briat Nantes
Once you know the trick it's super easy to get a patch from a MR, just add .patch at the end of the diff url:
https://git.drupalcode.org/project/drupal/-/merge_requests/4689/diffs => https://git.drupalcode.org/project/drupal/-/merge_requests/4689/diffs.patchThanks for the reviews!
- last update
about 1 year ago 30,605 pass - last update
about 1 year ago 30,667 pass - last update
about 1 year ago 30,675 pass 0:00 55:20 Running- last update
about 1 year ago 30,684 pass - last update
about 1 year ago 30,688 pass - Status changed to Needs work
about 1 year ago 5:49pm 3 December 2023 The Needs Review Queue Bot → tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide → to find step-by-step guides for working with issues.
- 🇸🇮Slovenia KlemenDEV
Could someone merge this with 10.2.0, so the patch can be used on Drupal 10.2.0 websites? Thanks!
- 🇸🇮Slovenia KlemenDEV
I have attempted to make a patch for 10.2.x myself. Feel free to use the patch for the merge request as making one myself is outside my knowledge of Drupal's Git system currently.
- last update
about 1 year ago 30,633 pass, 2 fail - 🇸🇮Slovenia KlemenDEV
Ok another attempt, this time only modifying legacy test and not FileImageDimensionsConstraintValidatorTest
- last update
about 1 year ago 30,637 pass - Merge request !5877Resolve #3292350 "File validate image resolution 10.2.x" → (Open) created by O'Briat
- Status changed to Needs review
about 1 year ago 2:14pm 19 December 2023 - 🇫🇷France O'Briat Nantes
Here's the MR for 10.2.x : https://git.drupalcode.org/project/drupal/-/merge_requests/5877 (patch https://git.drupalcode.org/project/drupal/-/merge_requests/5877/diffs.patch)
I also update the fork and other MRs, so this issue just need a review before been summited again
- 🇸🇮Slovenia KlemenDEV
Thanks @O'Briat! Since it is advised to use patches from drupal.org and not from drupalcode.org, I am attaching a patch file for the ones needing this on 10.2.x and want to use the patch made from the MR
- last update
about 1 year ago Build Successful - 🇫🇷France O'Briat Nantes
@KlemenDEV, could you provide a source about the advise not to use drupalcode.org? I could not find a mention about it in the doc (
https://www.drupal.org/docs/develop/git/using-gitlab-to-contribute-to-dr... → or https://www.drupal.org/docs/develop/git/using-git-to-contribute-to-drupa... → )Actually, I though patches were now deprecated in issue and MR are the recommended way to provide code changes...
- 🇸🇮Slovenia KlemenDEV
If one references MR directly (e.g. https://git.drupalcode.org/project/drupal/-/merge_requests/5877/diffs.patch), additional MR pushes will reflect in the patch file on the link too. Technically, someone could push malicious code and when updating with the composer, those changes would be picked up.
On drupal.org, uploaded patches can't be altered, so once validated by the user using it, they can be sure the contents of the file on the link will not change.
I can't find the original page where this was mentioned, but here is a similar discussion: https://github.com/cweagans/composer-patches/issues/347
- 🇫🇷France O'Briat Nantes
yes, on the first page : "Also note that if more commits are added to the merge request, the patch that you can download from that URL will change. So if you want to preserve a patch at a certain point, download the patch file and save it locally."
- Status changed to RTBC
about 1 year ago 1:23pm 20 December 2023 - 🇫🇷France O'Briat Nantes
Can someone could tell me which is the best version this patch should target in order to get merged into the next release (10.3) ?
11.x-dev or 10.2.x-dev
- 🇸🇰Slovakia poker10
There seems to be the MR !4164, which is for 11.x - that should be the main MR.
Patches are deprecated and drupal.org is going to move to MR-only flow sooner or later, so I am hiding all patches to clean this up. If you want to include a patch from MR, you need to download it locally, see: https://www.drupal.org/docs/develop/git/using-git-to-contribute-to-drupa... →
It's strongly recommended to lock the patch file versions on production sites. To do so you must download the patch file and use it in composer from a local directory. If you use the URL to the Gitlab MR directly, your codebase will change without warning, as people work on the merge request.
- last update
about 1 year ago 25,902 pass, 1,793 fail - 🇫🇷France O'Briat Nantes
@poker10 I don't know/remember why I had to create a MR to 11.x (com #18) but my initial goal was to target the current Drupal version, hence my MRs on 10.1.x and 10.2.x.
IMHO this fix could be part of the next 10.2.1 release (not 10.3.0 as I thought), so if everyone is agree and I didn't mess with the correct workflow, I change the target to 10.2.x-dev
- 🇸🇰Slovakia poker10
If the fix is relevant for the development branch as well, then the correct workflow, according to the Backport Policy ( https://www.drupal.org/about/core/policies/core-change-policies/backport... → ), should be:
1. Prepare a patch/MR against the development branch, which is 11.x-dev currently
2. Committers will commit the fix to this development branch
3. Committers will then cherry-pick the fix to stable branches (such as 10.2.x-dev), if the change is allowed thereTherefore the main MR should be the 11.x one, as that will be the starting point.
- 🇫🇷France O'Briat Nantes
Thanks, so the step 1 is OK since the MR-4164 targets the 11.x branch, and therefore I should use 11.x-dev as version for this issue?
- last update
12 months ago 25,934 pass, 1,822 fail - last update
12 months ago 25,974 pass, 1,789 fail - last update
12 months ago 25,935 pass, 1,810 fail - last update
12 months ago 25,890 pass, 1,833 fail - last update
12 months ago 25,889 pass, 1,830 fail - last update
12 months ago 25,948 pass, 1,822 fail - last update
12 months ago 25,952 pass, 1,854 fail - last update
12 months ago 25,926 pass, 1,822 fail - last update
12 months ago 26,002 pass, 1,838 fail - 🇸🇮Slovenia KlemenDEV
MR got some confirmations at https://www.drupal.org/project/clamav/issues/3058018 🐛 Use of Max Resolution on Image Field causes ClamAV Timeout in Deamon mode Needs review too, so I believe the MR fixes the problem.
Will this be merged in 11.x only or will 10.1/10.2 get a backport of this?
- 🇫🇷France O'Briat Nantes
Honestly I don't know, I do my best to provide a MR for the 11.x and 10.2.x, now it's in the hand of the core maintainers team.
Any tips for accelerating the process are welcome. - 🇳🇿New Zealand quietone
Changing title to explain what is being fixed.
There are policies such as Allowed changes during Drupal core release cycles → to decide which branches a change is applied to. Since this is a bug it can also be committed to 10.2.x.
- 🇫🇷France O'Briat Nantes
@quietone, the MR for 10.2 is ready, this issue is a "non-disruptive bug fixes" so it could be merge into the next "Patch releases"? Is there a step I missed that block the next step or all I have to do is wait?
- First commit to issue fork.
- Status changed to Fixed
10 months ago 12:23pm 26 February 2024 - 🇬🇧United Kingdom catch
It's overall slightly odd that we resize images in a validation step but that's a very old issue that's not introduced here. I rebased the MR from the UI, ran the test-only job, and suggested/applied a comment suggestion. Committed/pushed to 11.x and cherry-picked to 10.3.x and 10.2.x, thanks!
@Klemendev and O'Briat you weren't missing a step, there are just constantly around 150 issues and 10-20 or more added every day, so it can take a while for issues to get reviewed and committed. All issues should be posted against 11.x (we're using this in lieue of a 'main' branch) and then we backport as far as appropriate.
- 🇫🇷France O'Briat Nantes
@catch, thanks for the validation! It's my first core contribution.
I'm also a bit puzzled by the location of this action, it's also strange that the image API allows direct file modifications that could lead to inconsistencies between the file and image objects.
Automatically closed - issue fixed for 2 weeks with no activity.
- 🇧🇷Brazil fabiorubim740@outlook.com
fabiorubim740@outlook.com → changed the visibility of the branch 10.2.x to hidden.