Skip to content

Instantly share code, notes, and snippets.

@Ikke
Last active December 13, 2015 22:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ikke/4983768 to your computer and use it in GitHub Desktop.
Save Ikke/4983768 to your computer and use it in GitHub Desktop.
<?php
function upgrade_3_5_2b2() { //line 625
// fixing the effects of a previous bug affecting non-MyISAM users
if ( is_null( yarpp_get_option('weight') ) || //<-- this is one point where it errors out
!is_array( yarpp_get_option('weight') ) ) {
$weight = $this->default_options['weight'];
// if we're still not using MyISAM
if ( !yarpp_get_option('myisam_override') &&
$this->myisam_check() !== true ) {
unset( $weight['title'] );
unset( $weight['body'] );
}
yarpp_set_option(array('weight' => $weight));
}
}
diff --git a/class-core.php b/class-core_new.php
index d71ea77..39d6e32 100755
--- a/class-core.php
+++ b/class-core.php
@@ -624,16 +624,16 @@ class YARPP {
function upgrade_3_5_2b2() {
// fixing the effects of a previous bug affecting non-MyISAM users
- if ( is_null( yarpp_get_option('weight') ) ||
- !is_array( yarpp_get_option('weight') ) ) {
+ if ( is_null( $this->get_option('weight') ) ||
+ !is_array( $this->get_option('weight') ) ) {
$weight = $this->default_options['weight'];
// if we're still not using MyISAM
- if ( !yarpp_get_option('myisam_override') &&
+ if ( !$this->get_option('myisam_override') &&
$this->diagnostic_myisam_posts() !== true ) {
unset( $weight['title'] );
unset( $weight['body'] );
}
- yarpp_set_option(array('weight' => $weight));
+ $this->set_option(array('weight' => $weight));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment