Skip to content

pkp/pkp-lib#11171 Config data reset for writing at installation #11295

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: stable-3_5_0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions classes/config/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,14 @@ public static function &reloadData()
return $configData;
}

/**
* Reset the config data in registry
*/
public static function resetData()
{
Registry::set('configData', static::reloadData());
}

/**
* Set the path to the configuration file.
*
Expand Down
5 changes: 5 additions & 0 deletions classes/install/Installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,8 @@ public function updateConfig($configParams)
$this->wroteConfig = false;
}

Config::resetData();

return true;
}

Expand Down Expand Up @@ -949,8 +951,11 @@ public function checkPhpVersion()
*/
public function updateRorRegistryDataset(): bool
{
PKPApplication::upgrade();
Copy link
Member Author

@touhidurabir touhidurabir Apr 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to add this as below class calls internally PKPApplication::getHttpClient which try to retrieve the version information but we register the version details at the very end of installation phase and without this get null which raise exception .

This is due to the add of config reset after the config file update at the install phase which update the config installed to On which in return cause application to try to get version data before it got inserted and cause error as not available yet .


$updateRorRegistryDataset = new UpdateRorRegistryDataset();
$updateRorRegistryDataset->execute();

return true;
}

Expand Down
2 changes: 1 addition & 1 deletion classes/scheduledTask/ScheduledTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function __construct(private array $args = [])
if (!$success) {
// files directory wrong configuration?
assert(false);
$this->executionLogFile = null;
$this->executionLogFile = '';
}
}
}
Expand Down