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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix array_key_exists on objects (deprecated notice or fatal error) #1276

Merged
merged 1 commit into from
Mar 23, 2021
Merged

Fix array_key_exists on objects (deprecated notice or fatal error) #1276

merged 1 commit into from
Mar 23, 2021

Conversation

luigifab
Copy link
Contributor

@luigifab luigifab commented Oct 22, 2020

Description

This fix a notice or a fatal error when creating a new product in backend, I hope it's good.

PHP 7.4.6
array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead

PHP 8.0.0-rc2
Fatal error: Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, Mage_Core_Model_Config_Element given

OpenMage 20.0.5 / PHP 7.4.6 and 8.0.1

Manual testing scenarios

  1. Install PHP 7.4 or 8.0
  2. Go to, Catalog → Manage products
  3. Create a new product
  4. Press continue button

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All automated tests passed successfully (all builds are green)

@github-actions github-actions bot added the Component: Catalog Relates to Mage_Catalog label Oct 22, 2020
@joshua-bn
Copy link
Contributor

Any reason to not just use isset() there?

@kkrieger85 kkrieger85 added the hacktoberfest easy to solve issues for https://hacktoberfest.digitalocean.com/ participant (and everyone else) label Oct 22, 2020
@luigifab
Copy link
Contributor Author

luigifab commented Oct 26, 2020

No special reason, I have choose one of the solution.

@tmotyl tmotyl added the PHP 8 Related to PHP8 label Dec 31, 2020
@kkrieger85 kkrieger85 merged commit a04c1b2 into OpenMage:1.9.4.x Mar 23, 2021
@github-actions
Copy link
Contributor

Unit Test Results

1 files  ±0  1 suites  ±0   0s ⏱️ ±0s
0 tests ±0  0 ✔️ ±0  0 💤 ±0  0 ❌ ±0 
2 runs  ±0  2 ✔️ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit a04c1b2. ± Comparison against base commit 5ddb7a3.

@luigifab luigifab deleted the fix-array-key-exists-on-objet branch March 23, 2021 14:01
@luigifab luigifab restored the fix-array-key-exists-on-objet branch April 6, 2021 15:44
@luigifab luigifab deleted the fix-array-key-exists-on-objet branch April 6, 2021 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Catalog Relates to Mage_Catalog hacktoberfest easy to solve issues for https://hacktoberfest.digitalocean.com/ participant (and everyone else) PHP 8 Related to PHP8
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants