- πΈπ°Slovakia poker10
Thanks for reporting this. I do not see any patch, so it seems like Active is the correct status (there is nothing to review).
- Merge request !7522Issue #3212823: [D7] Don't trigger hook_file_download when no file is requested β (Open) created by poker10
- last update
7 months ago 2,179 pass - Status changed to Needs review
7 months ago 4:11pm 16 April 2024 - πΈπ°Slovakia poker10
I have backported the change from #3016814: Don't trigger hook_file_download when no file is requested β together with test changes.
Regular pipeline is green: https://git.drupalcode.org/project/drupal/-/pipelines/148353
Test only job is failing here: https://git.drupalcode.org/project/drupal/-/jobs/1343442---- FileDownloadTest ---- Status Group Filename Line Function -------------------------------------------------------------------------------- Fail Browser file.test 2647 FileDownloadTest->testPrivateFileTr Correctly returned 404 response for a private file url without a file specified. Fail Other file.test 2649 FileDownloadTest->testPrivateFileTr Value array ( ) is equal to value array ( 0 => array ( 0 => 'private://', ), ).
Moving to Needs review.
- last update
7 months ago 2,179 pass - π¬π§United Kingdom mcdruid π¬π§πͺπΊ
This looks pretty good but I'm not sure about the assertions that reference an element on the return value of
variable_get()
- e.g.:$this->assertEqual($file->uri, variable_get('file_test_results', array())['download'][0][0]);
Perhaps it's safe to assume that the variable will always be set and that element will be present, but if we do something similar in isolation:
$ drush php Psy Shell v0.9.12 (PHP 7.4.33 β cli) by Justin Hileman >>> print_r(variable_get('file_test_results', array())['download'][0][0]); PHP Notice: Undefined index: download in phar:///usr/local/bin/drush8/vendor/composer/..eval()'d code on line 1
It may make the code more long-winded but can we avoid this?
- last update
6 months ago 2,180 pass - πΈπ°Slovakia poker10
Yes, I was on the edge when backporting these rows. Seems like we can use
file_test_get_all_calls()
to retrieve these results too, so I have updated the MR with this change. Hopefully now it is cleaner and safer. Thanks!Tests are still green: https://git.drupalcode.org/project/drupal/-/pipelines/187591
And test-only job is still failing: https://git.drupalcode.org/project/drupal/-/jobs/1743067 -
mcdruid β
committed 7a6e1783 on 7.x
Issue #3212823 by poker10, vctlzac, apaderno, mcdruid: [D7] Do not...
-
mcdruid β
committed 7a6e1783 on 7.x
- Status changed to Fixed
6 months ago 10:57am 3 June 2024 - π¬π§United Kingdom mcdruid π¬π§πͺπΊ
Thanks - it's a bit circuitous but I think better to avoid potentially(/theoretically) referencing non-existent elements.
Automatically closed - issue fixed for 2 weeks with no activity.