Problem/Motivation
Acceptance criteria
We want to make $edit[0], $edit[1], ... until $edit[$repeat_count - 1] . In the current code, $edit will be overwritten in the loop.
BEFORE (current):
$edit = [];
for ($i = 0; $i < $repeat_count; $i++) {
$edit = [
['k8s_js_refresh_interval' => rand(1, 9999)],
['k8s_update_pricing_data_cache' => !$config->get('k8s_update_pricing_data_cache')],
['k8s_view_expose_items_per_page' => !$config->get('k8s_view_expose_items_per_page')],
['k8s_view_items_per_page' => $items_per_page[array_rand($items_per_page)]],
['k8s_update_resources_queue_cron_time' => rand(1, 9999)],
['k8s_queue_limit' => rand(1, 50)],
['k8s_yaml_file_extensions' => $this->random->name(10, TRUE)],
];
}
AFTER:
$edit = [];
for ($i = 0; $i < $repeat_count; $i++) {
$edit[] = [
'k8s_js_refresh_interval' => rand(1, 9999),
'k8s_update_pricing_data_cache' => !$config->get('k8s_update_pricing_data_cache'),
'k8s_view_expose_items_per_page' => !$config->get('k8s_view_expose_items_per_page'),
'k8s_view_items_per_page' => $items_per_page[array_rand($items_per_page)],
'k8s_update_resources_queue_cron_time' => rand(1, 9999),
'k8s_queue_limit' => random_int(1, 50), // WE SHOULD USE `ramdom_int()`
'k8s_yaml_file_extensions' => $this->random->name(10, TRUE),
];
}
Issue fork cloud-3246330
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3246330-Fix-The-Logic-Of-Edit-In-Aws
changes, plain diff MR !484
Comments
Comment #2
yutong.li commentedComment #4
yutong.li commentedComment #6
yutong.li commentedComment #7
yas@yutong.li
Thank you for fixing the logic. It looks good to me. I'll merge the patch to
4.xand close this issue as Fixed.Comment #10
yas