Skip to content
This repository has been archived by the owner on Oct 23, 2021. It is now read-only.

Notice: undefined index #57

Open
Polfo opened this issue Jan 12, 2015 · 1 comment
Open

Notice: undefined index #57

Polfo opened this issue Jan 12, 2015 · 1 comment

Comments

@Polfo
Copy link

Polfo commented Jan 12, 2015

Hello

First of all, thanks for this great plugin and your time spent on sharing, improving and supporting this.

I have a fresh and clean wordpress 4.1 installation with the twenty thirteen theme and only two plugins:

Everything works fine, except when I define('WP_DEBUG', true); in wp-config.php. In that case, when Publishing a New Demo Post, it goes wrong with the following error messages:

Notice: Undefined index: checkboxes-demo in /xxx/wp-content/plugins/super-cpt/includes/class-super-custom-post-meta.php on line 670
Notice: Undefined index: radio-buttons-demo in /xxx/wp-content/plugins/super-cpt/includes/class-super-custom-post-meta.php on line 670
Notice: Undefined index: multi-select-demo in /xxx/wp-content/plugins/super-cpt/includes/class-super-custom-post-meta.php on line 670
Notice: Undefined index: checkboxes-demo in /xxx/wp-content/plugins/super-cpt/includes/class-super-custom-post-meta.php on line 670
Notice: Undefined index: radio-buttons-demo in /xxx/wp-content/plugins/super-cpt/includes/class-super-custom-post-meta.php on line 670
Notice: Undefined index: multi-select-demo in /xxx/wp-content/plugins/super-cpt/includes/class-super-custom-post-meta.php on line 670
Warning: Cannot modify header information - headers already sent by (output started at /xxx/wp-content/plugins/super-cpt/includes/class-super-custom-post-meta.php:670) in /xxx/wp-admin/post.php on line 233
@Polfo
Copy link
Author

Polfo commented Jan 12, 2015

This seems the same as #23, #25 and #50, but is is different.

  1. The workaround is 'default' => 'one', which might affect the desired result when the user does not fill in the field (the field is not checked in the GUI by default but set in the database on publish by default).
  2. @cf5aaf2 does not solve the issue. Using the code modified by @cf5aaf2, I still see these erors appearing:
Notice: Undefined index: checkboxes-demo in /xxx/wp-content/plugins/super-cpt/includes/class-super-custom-post-meta.php on line 676
Notice: Undefined index: radio-buttons-demo in /xxx/wp-content/plugins/super-cpt/includes/class-super-custom-post-meta.php on line 676
Notice: Undefined index: multi-select-demo in /xxx/wp-content/plugins/super-cpt/includes/class-super-custom-post-meta.php on line 676

Which references the same code but at it's new line number
676 if ( is_array( $_POST[ $field ] ) ) {
The modifications of @cf5aaf2 do not affect this line

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

No branches or pull requests

1 participant