- Merge request !3057Issue #3324952: add a method to NestedArray that does array_walk_recursive but passes the parents to the callback → (Open) created by joachim
The 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.
- Status changed to Needs review
over 2 years ago 7:23am 18 February 2023 - Status changed to Needs work
over 2 years ago 1:12pm 18 February 2023 The 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.
- Status changed to Needs review
over 2 years ago 5:07pm 18 February 2023 - 🇬🇧United Kingdom joachim
369 | ERROR | Parameter $array is not described in comment 372 | ERROR | Doc comment for parameter &$array does not match | | actual variable name $callbackThis does not match up with the file in the MR.
Line 369 is:
/**Line 372 is:
* @param array &$array * A reference to the array to operate on. - Status changed to Needs work
over 2 years ago 5:53pm 18 February 2023 - 🇧🇷Brazil murilohp
I was reviewing the code here @joachim and I was able to reproduce the bot error running:
vendor/bin/phpcs -ps --parallel=$(nproc) --standard="core/phpcs.xml.dist"(the same executed by the commit-code-check.sh script)The error seems confused, but as far as I could see, this was being caused due to the
arrayWalkNesteddocumenting an &$array and the function was expecting $array, I'm moving this back NW to see your thoughts here. - 🇬🇧United Kingdom joachim
Thanks! That's probably it.
This needs tests -- without that missing '&' it wouldn't work at all!
- Status changed to Needs review
over 2 years ago 7:29pm 19 February 2023 - 🇧🇷Brazil murilohp
Just added a new test, I've also changed a little bit the code, the new test is now changing the values of a nested array. Moving back to NR
- Status changed to RTBC
over 2 years ago 2:28pm 21 February 2023 - 🇺🇸United States smustgrave
Just FYI ideally even though the title says it all, should add the proposed solution to the issue summary.
But can tell what you are doing here. Changes aren't large.
Test coverage seems good.
Typehinting complete.Seems like a good addition to have.
- 🇬🇧United Kingdom joachim
if (is_array($value)) { self::arrayWalkNestedRecursive($value, $callback, $current_parents); + continue; } - else { - $callback($value, $current_parents); - } + $callback($value, $current_parents); }Nitpicking, but I preferred this the way I wrote it as an if/else rather than a guard clause.
- last update
over 2 years ago 29,284 pass - last update
over 2 years ago 29,294 pass, 2 fail - last update
over 2 years ago 29,303 pass - last update
over 2 years ago 29,301 pass - last update
over 2 years ago 29,362 pass - last update
over 2 years ago 29,367 pass - last update
over 2 years ago 29,368 pass - 🇬🇧United Kingdom catch
One comment on the MR. Also are there any contrib modules that can use this?
- Status changed to Needs review
over 2 years ago 4:41pm 2 May 2023 - 🇬🇧United Kingdom joachim
> One comment on the MR. Also are there any contrib modules that can use this?
Yes -- see https://git.drupalcode.org/project/computed_field/-/blob/4.0.x/src/Eleme... for example.
Basically, you need it anywhere where you need to recurse into an arbitrary form array, and the thing you do to each element needs to be aware of the position of the element in the form.
Replied to comment on MR.
- Status changed to RTBC
over 2 years ago 10:46pm 5 May 2023 - 🇺🇸United States smustgrave
All threads appear to have been answered and this already seemed to get several reviews.
- last update
over 2 years ago 29,379 pass - last update
over 2 years ago 29,380 pass - last update
over 2 years ago 29,381 pass - last update
over 2 years ago 29,384 pass - last update
over 2 years ago 29,389 pass - last update
over 2 years ago 29,388 pass, 2 fail - last update
over 2 years ago 29,389 pass - last update
over 2 years ago 29,388 pass, 2 fail - last update
over 2 years ago 29,388 pass, 2 fail - last update
over 2 years ago 29,396 pass - last update
over 2 years ago 29,397 pass - last update
over 2 years ago 29,400 pass - last update
over 2 years ago 29,400 pass - last update
over 2 years ago 29,401 pass - last update
over 2 years ago 29,410 pass - last update
over 2 years ago 29,415 pass - last update
over 2 years ago 29,419 pass - last update
over 2 years ago 29,421 pass - last update
over 2 years ago 29,421 pass - last update
over 2 years ago 29,426 pass - Status changed to Needs work
over 2 years ago 2:19pm 14 June 2023