uoregon / WPSpin

A WordPress plugin providing integration with Spinitron's SpinPAPI API service.
GNU General Public License v2.0
3 stars 5 forks source link

Metaboxes don't save #15

Closed Pythagory closed 11 years ago

Pythagory commented 11 years ago

Issue reported by email:

Issue: Metaboxes never save because the nonce never matches.

File: showmetabox.php, included by showcontroller.php in optionsMetaBox function wp_nonce_field( basename( FILE ), 'wpspin_show_options_nonce' );

File: showcontroller.php, in function metaBoxSave wp_verify_nonce($_POST['wpspin_show_options_nonce'], basename(FILE));

The problem is that basename(FILE) is showmetabox.php in first file and showcontroller.php in other. So it will never match, therefore never save my metabox info. Same with profilecontroller.php and profilemetabox.php

I did a temporary fix for my version of plugin:

File: showcontroller.php, in function optionsMetaBox $basename = basename(FILE); include DIR . "/../views/showmetabox.php";

File: showmetabox.php, included by showcontroller.php in optionsMetaBox >function wp_nonce_field($basename, 'wpspin_show_options_nonce' );

So now they both refer to showcontroller.php

Pythagory commented 11 years ago

Updated: Apparently this was referring to an old version, no longer relevant.