Skip to content

Commit 7200487

Browse files
Merge pull request #76 from boldbart/fix/decrypt-openai-project-id
Decrypt OpenAI project ID before passing it to the client
2 parents 9c7c4fa + 76b4242 commit 7200487

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
# Automatic Translation
2+
## [2.4.0] - 16/10/2026
3+
### Changed
4+
- Renamed console commands to match what they do: `mage-os:procedure:test` is now `mage-os:translate:products` and `mage-os:select-attribute:test` is now `mage-os:translate:product-select-attribute-options`
5+
### Fixed
6+
- Fixed the OpenAI project ID being sent encrypted to OpenAI, which made every request fail with "Invalid project ID" and left the GPT model dropdown empty
7+
28
## [2.3.2] - 16/10/2026
39
### Fixed
410
- Fixed a "null as an array offset" error that broke the new category form under PHP 8.5

‎Helper/ModuleConfig.php‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,12 @@ public function getOpenAIApiKey(): string
174174
*/
175175
public function getOpenAIProjectId(): string
176176
{
177-
return (string)$this->scopeConfig->getValue(self::OPEN_AI_PROJECT_ID, ScopeInterface::SCOPE_STORE, 0);
177+
$encryptedProjectId = (string)$this->scopeConfig->getValue(
178+
self::OPEN_AI_PROJECT_ID,
179+
ScopeInterface::SCOPE_STORE,
180+
0
181+
);
182+
return $this->encryptor->decrypt($encryptedProjectId);
178183
}
179184

180185
/**
@@ -199,7 +204,7 @@ public function getOpenAIModel(): string
199204
public function getGeminiApiKey(): string
200205
{
201206
$encryptedApiKey = (string)$this->scopeConfig->getValue(self::GEMINI_API_KEY, ScopeInterface::SCOPE_STORE, 0);
202-
return $this->encryptor->decrypt($encryptedApiKey);
207+
return (string)$this->encryptor->decrypt($encryptedApiKey);
203208
}
204209

205210
/**

0 commit comments

Comments
 (0)