Skip to content

fix: ensure organizationalUnit is converted before engine initialization#6127

Merged
vitormattos merged 1 commit intomainfrom
fix/migration-ou-type-error
Dec 11, 2025
Merged

fix: ensure organizationalUnit is converted before engine initialization#6127
vitormattos merged 1 commit intomainfrom
fix/migration-ou-type-error

Conversation

@vitormattos
Copy link
Copy Markdown
Member

The migration was failing during upgrade to stable32 because it tried to set organizationalUnit as a string when the property expects an array.

The issue occurred because addConfigPathToOpenSsl() (which calls getEngine() and triggers populateInstance()) was executed before convertRootCertOuStringToArray().

This fix reorders the method calls in preSchemaChange() to convert the OU value to an array before initializing the engine, preventing the TypeError.

Fixes the error:
TypeError: Cannot assign string to property
OCA\Libresign\Handler\CertificateEngine\AEngineHandler::$organizationalUnit of type array

The migration was failing during upgrade to stable32 because it tried to
set organizationalUnit as a string when the property expects an array.

The issue occurred because addConfigPathToOpenSsl() (which calls getEngine()
and triggers populateInstance()) was executed before convertRootCertOuStringToArray().

This fix reorders the method calls in preSchemaChange() to convert the OU
value to an array before initializing the engine, preventing the TypeError.

Fixes the error:
TypeError: Cannot assign string to property
OCA\Libresign\Handler\CertificateEngine\AEngineHandler::$organizationalUnit
of type array

Signed-off-by: Vitor Mattos <[email protected]>
@vitormattos vitormattos added this to the Next Major (33) milestone Dec 11, 2025
@vitormattos vitormattos self-assigned this Dec 11, 2025
@github-project-automation github-project-automation Bot moved this to 0. Needs triage in Roadmap Dec 11, 2025
@vitormattos
Copy link
Copy Markdown
Member Author

/backport to stable32

@vitormattos
Copy link
Copy Markdown
Member Author

/backport to stable31

@vitormattos vitormattos merged commit 5a73261 into main Dec 11, 2025
65 checks passed
@vitormattos vitormattos deleted the fix/migration-ou-type-error branch December 11, 2025 19:19
@github-project-automation github-project-automation Bot moved this from 0. Needs triage to 4. to release in Roadmap Dec 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

1 participant