Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure unserialized is array #15823

Merged
merged 2 commits into from Aug 28, 2023
Merged

Make sure unserialized is array #15823

merged 2 commits into from Aug 28, 2023

Conversation

Cruiser13
Copy link
Contributor

@Cruiser13 Cruiser13 commented Aug 24, 2023

Changes in this pull request

Unserialized may be false sometimes which will cause the following error when running the migration:

[error] Migration Pimcore\Bundle\CoreBundle\Migrations\Version20230424084415 failed during Execution. Error: "array_key_exists(): Argument #2 ($array) must be of type array, bool given"
17:29:18 CRITICAL [console] Error thrown while running command "doctrine:migrations:migrate". Message: "array_key_exists(): Argument #2 ($array) must be of type array, bool given" ["exception" => TypeError { 鈥,"command" => "doctrine:migrations:migrate","message" => "array_key_exists(): Argument #2 ($array) must be of type array, bool given"]
In Version20230424084415.php line 40:
array_key_exists(): Argument #2 ($array) must be of type array, bool given

Make sure that unserialized is an array and skip otherwise or Pimcore 10 > 11 updates might fail.

Additional info

WHAT

馃 Generated by Copilot at 9f802ac

Fix migration of document editables from Pimcore 5 to Pimcore 10. Add array check to unserialize result in Version20230424084415.php.

馃 Generated by Copilot at 9f802ac

unserialize /
check if array or not /
fall migration fix

HOW

馃 Generated by Copilot at 9f802ac

  • Add a check for array type before accessing keys of $unserialized variable in Version20230424084415.php (link)

@github-actions
Copy link

Review Checklist

  • Target branch (11.0 for bug fixes, others 11.x)
  • Tests (if it's testable code, there should be a test for it - get help)
  • Docs (every functionality needs to be documented, see here)
  • Migration incl. install.sql (e.g. if the database schema changes, ...)
  • Upgrade notes (deprecations, important information, migration hints, ...)
  • Label
  • Milestone

Co-authored-by: Sebastian Blank <sebastian.bl@gmx.de>
@sonarcloud
Copy link

sonarcloud bot commented Aug 25, 2023

Kudos, SonarCloud Quality Gate passed!聽 聽 Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
1.1% 1.1% Duplication

@dvesh3 dvesh3 added the Bug label Aug 28, 2023
@dvesh3 dvesh3 added this to the 11.0.8 milestone Aug 28, 2023
@dvesh3 dvesh3 merged commit 3848d35 into pimcore:11.0 Aug 28, 2023
15 checks passed
@dvesh3
Copy link
Contributor

dvesh3 commented Aug 28, 2023

@Cruiser13 thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants