Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Invalid argument supplied for foreach() UpdateChecklist.php:181
and
count(): Parameter must be an array or an object that implements Countable UpdateChecklist.php:210
are a couple errors when building out a Varbase distro.Simple little things but I'm sorry I'm not able to give a patch for them now.
Proposed resolution
Proposed fix for the issue by Alex Pott (alexpott)
This is not the expected format for
$checklist->markUpdatesSuccessful($update_ids, TRUE);
. It should be:$update_ids = [ 'varbase_core' => [ 'varbase_core_optional_update_8601', 'varbase_core_optional_update_8602', 'varbase_core_optional_update_8603', 'varbase_core_optional_update_8604', 'varbase_core_optional_update_8605', 'varbase_core_optional_update_8606', 'varbase_core_optional_update_8607', 'varbase_core_update_8608', 'varbase_core_update_8610', 'varbase_core_optional_update_8701', 'varbase_core_optional_update_8702', 'varbase_core_update_8703', 'varbase_core_update_8704', 'varbase_core_optional_update_8705', 'varbase_core_optional_update_8706', ], 'varbase_admin' => [ 'varbase_admin_update_8602', ] ];
Note that the other code in this method will need adjusted too.
Remaining tasks
- ✅ File an issue about this project
- ✅ Fix array to mark all updates by the update helper checklist as successful on install.
- ✅ Testing to ensure no regression
- ➖ Automated unit/functional testing coverage
- ➖ Developer Documentation support on feature change/addition
- ➖ User Guide Documentation support on feature change/addition
- ➖ Update Release Notes and Update Helper on new feature change/addition
- ✅ Code review from 1 Varbase core team member
- ✅ Full testing and approval
- ✅ Credit contributors
- ✅ Review with the product owner
- ✅ Release varbase-9.0.3, varbase_core-9.0.12
Varbase update type:
- ✅ No Update
- ➖ Optional Update
- ➖ Forced Update
- ➖ Forced Update if Unchanged
User interface changes
- N/A
API changes
- N/A
Data model changes
- N/A
Comments
Comment #2
alexpottI've looked over where this code is called and this is not caused by anything in the Update Helper module. It's caused by
varbase_update_helper_install()
.This function is passing in the following array.
This is not the expected format for
$checklist->markUpdatesSuccessful($update_ids, TRUE);
. It should be:Note that the other code in this method will need adjusted too.
FWIW I'm not sure why any of this code is needed in varbase. I think
update_helper_checklist_install()
should be handling this already.Comment #3
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot for Vardot commentedThank you, Alex for moving the issue to Varbase Core.
It will be tested and fixed.
Comment #4
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot for Vardot commentedComment #5
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot for Vardot commentedAlex, Some sites may not have the module installed by default.
On install it should show
100%
This is to fix the status to 100% on install and on an installation for optional components or in a Sub Profiles
The Update Helper module had performance issues
When the site admin decided to disable the module then enable it again.
The site will end up with some weird status like
106%
,112%
or109%
.And some time we get
60%
or40%
if the active site had changes at the time of enabling of a new module, which could do a small change in active config.Before it was
$checklist->getPercentComplete() != 100
which is wrong and we had it fixed with$checklist->getPercentComplete() < 100
in #3118031: Fix performance for anonymous users on page load for [Update Helper Checklist] module with XHProf statisticsNoticed your new commit on the issue to fix this.
Comment #6
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot for Vardot commentedComment #7
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot for Vardot commentedComment #8
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot for Vardot commentedComment #9
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot for Vardot commentedComment #11
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot for Vardot commentedComment #12
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot for Vardot commentedComment #13
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot for Vardot commentedComment #14
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot for Vardot commentedComment #15
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot for Vardot commented