- Issue created by @alexpott
- Status changed to Needs review
over 1 year ago 12:59am 23 November 2023 - 🇭🇺Hungary Gábor Hojtsy Hungary
I think this makes sense. Why do you need to add the NULL filter though? How is that related?
- 🇬🇧United Kingdom alexpott 🇪🇺🌍
@Gábor Hojtsy because LocaleProjectStorage is has several bugs - if you don't add the NULL filter than the key will remain in the ouput if you do ::getAll after a ::delete... the new test added here confirms tests this behaviour and leaving the bug in felt irresponsible.
Also fixed here is changing the property all from a static to a regular class property because that has no business being static when $cache is not.
- 🇬🇧United Kingdom alexpott 🇪🇺🌍
The one thought here is should we obey the order generated by
locale_translation_project_list()
instead or adding a weight key and sorting by key.The sorting by key behaviour is the current behaviour - unless you've just called
locale_translation_build_projects()
for the first time. At that point it will be in the order thatlocale_translation_project_list()
returns until the process ends. Any subsequent process will get it in the key order.I went for the current change because I think it is less risky for current sites which might be relying on the current order to have translations work out the way they want.
- Status changed to RTBC
over 1 year ago 11:51pm 24 November 2023 - 🇪🇸Spain penyaskito Seville 💃, Spain 🇪🇸, UTC+2 🇪🇺
Code-wise LGTM.
The only issue we can have with this is altering what people is expecting on their projects. But given we are actually making it deterministic, any expectation they had before this MR is merged is actually wrong and not reliable. So it's definitely not making things worse for them, actually providing a way to fix it via weight if they need to.
So IMHO this is RTBC.
- 🇬🇧United Kingdom alexpott 🇪🇺🌍
Created the CR - https://www.drupal.org/node/3404117 →
- First commit to issue fork.
- 🇳🇿New Zealand quietone
I'm triaging RTBC issues → . I read the IS and the comments. I didn't find any unanswered questions.
I read the MR and found a grammar error which I fixed, and I also rebased. The change record also had a sentence that needed rewording so I did that too. I also moved the example to a separate heading.
I tested locally and the test does fail without the code changes.
I also updated credit.
Since the change to the MR was minor in a comment I am leaving at RTBC.
- Status changed to Needs work
about 1 year ago 5:35pm 19 January 2024 The Needs Review Queue Bot → tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily 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.
- 🇮🇳India Akhil Babu Chengannur
Akhil Babu → made their first commit to this issue’s fork.
- 🇮🇳India Akhil Babu Chengannur
Akhil Babu → changed the visibility of the branch 11.x to hidden.
- Status changed to Needs review
about 1 year ago 6:14am 24 January 2024 - 🇮🇳India Akhil Babu Chengannur
Added
declare(strict_types=1)
to the test as per #12. Moving to needs review - 🇺🇸United States smustgrave
Left some small updates. Leaving in NR for additional eyes.
- Status changed to RTBC
about 1 year ago 7:52pm 6 February 2024 - Status changed to Needs work
about 1 year ago 3:38am 26 February 2024 - 🇳🇿New Zealand quietone
I'm triaging RTBC issues → . I read the IS, the comments and the MR.
I left some work in the MR, so setting to needs work. I just noticed that I suggested a change that alexpott removed but I have to go right now and can't follow up.
- First commit to issue fork.
- Status changed to Needs review
about 1 year ago 7:18am 26 February 2024 - 🇬🇧United Kingdom alexpott 🇪🇺🌍
@vakulrai
return array_filter($this->cache, fn ($value) => $value !== NULL);
is not the same as
return array_filter($this->cache);
The latter will remove empty arrays, FALSEs and empty strings which is not the current behaviour. We only want to remove the NULLs and the \Drupal\Tests\locale\Kernel\LocaleTranslationProjectsTest::testLocaleTranslationClearCacheProjects() relied on this. - 🇳🇿New Zealand quietone
So, I make comments on the MR but didn't save them. I have done that now but now the conversation isn't in the correct order.
- 🇳🇿New Zealand quietone
The result of the last day here is changes to comments. And I just made another one to correct tense. The questions I raised in the MR resulted in code changes that were reverted by alexpott, with explanation.
- Status changed to RTBC
about 1 year ago 2:37pm 27 February 2024 - 🇺🇸United States smustgrave
Reviewed and appears that feedback has been addressed
- Status changed to Fixed
about 1 year ago 3:02pm 4 March 2024 - 🇬🇧United Kingdom catch
Reviewing this I had a similar thought process to #7 and would have leaned on respecting the order of local_translation_project_list() but I think that would have taken even more refactoring, so adding the explicit weight key seems OK.
Committed/pushed to 11.x and cherry-picked to 10.3.x, thanks!
-
longwave →
committed f0be4c1c on 10.3.x
Revert "Issue #3403337 by alexpott, quietone, Akhil Babu, vakulrai,...
-
longwave →
committed f0be4c1c on 10.3.x
-
longwave →
committed d7602652 on 11.x
Revert "Issue #3403337 by alexpott, quietone, Akhil Babu, vakulrai,...
-
longwave →
committed d7602652 on 11.x
- Status changed to Needs work
about 1 year ago 11:32pm 5 March 2024 - 🇬🇧United Kingdom longwave UK
Reverted, as the new unit test fails on PHP 8.3 (but not 8.1 or 8.2):
$ php8.3 vendor/bin/phpunit -c core core/modules/locale/tests/src/Unit/LocaleProjectStorageTest.php PHPUnit 9.6.15 by Sebastian Bergmann and contributors. Testing Drupal\Tests\locale\Unit\LocaleProjectStorageTest F. 2 / 2 (100%) Time: 00:00.471, Memory: 4.00 MB There was 1 failure: 1) Drupal\Tests\locale\Unit\LocaleProjectStorageTest::testSorting Failed asserting that two arrays are identical. --- Expected +++ Actual @@ @@ Array &0 ( - 0 => 'd' - 1 => 'a' - 2 => 'b' - 3 => 'c' + 0 => 'a' + 1 => 'b' + 2 => 'c' + 3 => 'd' ) /var/www/html/drupal/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php:121 /var/www/html/drupal/vendor/phpunit/phpunit/src/Framework/Constraint/IsIdentical.php:79 /var/www/html/drupal/core/modules/locale/tests/src/Unit/LocaleProjectStorageTest.php:58 /var/www/html/drupal/vendor/phpunit/phpunit/src/Framework/TestResult.php:728 FAILURES! Tests: 2, Assertions: 9, Failures: 1.
- Status changed to RTBC
about 1 year ago 11:22am 6 March 2024 - 🇬🇧United Kingdom alexpott 🇪🇺🌍
Turns out this is a PHP 8.3 bug - see https://github.com/php/php-src/pull/13285 - fortunately a work around is pretty simple - see https://git.drupalcode.org/project/drupal/-/merge_requests/5507/diffs?co...
- 🇬🇧United Kingdom alexpott 🇪🇺🌍
Also in the interim testing is now defaulting to PHP 8.3 so if we the main pipeline is green we know we're fixed it.
-
longwave →
committed c1634b16 on 10.3.x
Issue #3403337 by alexpott, quietone, Akhil Babu, vakulrai, smustgrave,...
-
longwave →
committed c1634b16 on 10.3.x
-
longwave →
committed e7e4e0e7 on 11.x
Issue #3403337 by alexpott, quietone, Akhil Babu, vakulrai, smustgrave,...
-
longwave →
committed e7e4e0e7 on 11.x
- 🇬🇧United Kingdom longwave UK
Nice that we found a PHP bug, even better that it's already fixed - and that we can work around it here.
Committed and pushed e7e4e0e776 to 11.x and c1634b16eb to 10.3.x. Thanks!
- Status changed to Fixed
about 1 year ago 2:59pm 6 March 2024 Automatically closed - issue fixed for 2 weeks with no activity.