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

Import/export does not handle named arrays #21600

Open
11 tasks
igorschoester opened this issue Sep 4, 2024 · 1 comment
Open
11 tasks

Import/export does not handle named arrays #21600

igorschoester opened this issue Sep 4, 2024 · 1 comment
Labels

Comments

@igorschoester
Copy link
Member

igorschoester commented Sep 4, 2024

  • I've read and understood the contribution guidelines.
  • I've searched for any related issues and avoided creating a duplicate issue.

Please give us a description of what happened

To Reproduce

Step-by-step reproduction instructions

  1. Enable the Wincher integration feature
  2. Connect with Wincher
  3. Export settings
  4. Search for wincher_tokens and notice missing keys, i.e. 6 times wincher_tokens[] = ""
  5. Copy the export and paste in the import settings
  6. Import the settings
  7. Edit a post
  8. You will now get PHP notices about missing key names

Expected results

  1. Exporting and then importing should not result in differences

Actual results

  1. Resulting in differences

Screenshots, screen recording, code snippet

If possible, please provide a screenshot, a screen recording or a code snippet which demonstrates the bug.

Technical info

It seems we never supported named arrays:

for ( $i = 0; $i < $count; $i++ ) {
$elem_check = ( $elem[ $i ] ?? null );
$this->write_setting( $key . '[]', $elem_check );
}

But we do use those. Not just for Wincher.

  • If relevant, which editor is affected (or editors):
  • Block Editor
  • Gutenberg Editor
  • Elementor Editor
  • Classic Editor
  • Other:
  • Which browser is affected (or browsers):
  • Chrome
  • Firefox
  • Safari
  • Other:

Used versions

  • Device you are using:
  • Operating system:
  • PHP version:
  • WordPress version:
  • WordPress Theme:
  • Yoast SEO version: 23.5
  • Gutenberg plugin version:
  • Elementor plugin version:
  • Classic Editor plugin version:
  • Relevant plugins in case of a bug:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants
@manuelaugustin @igorschoester and others