The MU forums have moved to WordPress.org

WordPress MU 1.3 (73 posts)

  1. re5et
    Member
    Posted 16 years ago #

    Thanks luna, After looking into it, wp_sitecategories does only seem to serve the purpose of goofing stuff up for no reason, i really have no idea why it is being used in that function.

    For me the solution was as follows:

    non-working original function referencing wp_sitecategories:(giving me 3 db errors)

    function global_terms( $term_id, $tt_id ) {
    	global $wpdb;
    
    	$term_id = intval( $term_id );
    	$c = $wpdb->get_row( "SELECT * FROM $wpdb->terms WHERE term_id = '$term_id'" );
    
    	$global_id = $wpdb->get_var( "SELECT cat_ID FROM $wpdb->sitecategories WHERE category_nicename = '" . $wpdb->escape( $c->slug ) . "'" );
    
    	if ( $global_id == null ) {
    		$wpdb->query( "INSERT INTO $wpdb->sitecategories ( cat_name, category_nicename ) VALUES ( '" . $wpdb->escape( $c->name ) . "', '" . $wpdb->escape( $c->slug ) . "' )" );
    		$global_id = $wpdb->insert_id;
    	}
    
    	if ( $global_id == $term_id )
    		return $global_id;
    
    	$wpdb->query( "UPDATE $wpdb->terms SET term_id = '$global_id' WHERE term_id = '$term_id'" );
    	$wpdb->query( "UPDATE $wpdb->term_taxonomy SET term_id = '$global_id' WHERE term_id = '$term_id'" );
    	$wpdb->query( "UPDATE $wpdb->term_taxonomy SET parent = '$global_id' WHERE parent = '$term_id'" );
    
    	$wpdb->query( "UPDATE $wpdb->categories SET cat_ID = '$global_id' WHERE cat_ID = '$term_id'" );
    	$wpdb->query( "UPDATE $wpdb->categories SET category_parent = '$global_id' WHERE category_parent = '$term_id'" );
    
    	clean_term_cache($global_id, 'category');
    	clean_term_cache($global_id, 'post_tag');
    
    	return $global_id;
    }

    working function i am currently using:(no errors)

    function global_terms( $term_id ) {
    	global $wpdb;
    
    	$term_id = intval( $term_id );		
    
    	$wpdb->query( "UPDATE $wpdb->terms SET term_id = '$term_id' WHERE term_id = '$term_id'" );
    	$wpdb->query( "UPDATE $wpdb->term_taxonomy SET term_id = '$term_id' WHERE term_id = '$term_id'" );
    	$wpdb->query( "UPDATE $wpdb->term_taxonomy SET parent = '$term_id' WHERE parent = '$term_id'" );
    
    	clean_term_cache($term_id, 'category');
    	clean_term_cache($term_id, 'post_tag');
    
    	return $term_id;
    }

    I also removed the $tt_id from the arguments because the function doesn't do anything with it :p

  2. IronCube
    Member
    Posted 16 years ago #

    Feel free to submit a trac ticket : http://trac.mu.wordpress.org/

    :D

  3. Farms
    Member
    Posted 16 years ago #

    Hmmmm... upgrading does seem to insert slashes as moorezilla described earlier (http://mu.wordpress.org/forums/topic.php?id=6672&page&replies=62#post-39724)

    Only in title and tagline areas though... could is be something to do with the upgrade script?

    Ha sanyone else encountered or fixed this :)

    Cheers, James

  4. Farms
    Member
    Posted 16 years ago #

    Is nobody else having this issue? It's a pretty big one for us upgraders!

  5. moorezilla
    Member
    Posted 16 years ago #

    The slashes were definitely added on my blogs, but since we don't have too many blogs at our school, I just removed the slashes to fix the problem. I don't have an explanation for where they came from... sorry.

  6. enseignement
    Member
    Posted 16 years ago #

    I'm having this issue ... :(

  7. Farms
    Member
    Posted 16 years ago #

    Well, that's three of us... and I can vouch for at last 50 different installs... I reckon it's an upgrade bug... maybe to do with characters and particular fields?

  8. Bike
    Member
    Posted 16 years ago #

    I had it too. Am still in testing phase with just a few blogs, so was not a huge problem, but when upgrading from 1.25a to latest 1.3 version xx's blog was turned into xx\'s blog.

    Cheers, Bike

  9. lunabyte
    Member
    Posted 16 years ago #

    I haven't played with upgrading yet, mainly because of the current issues at hand. Maybe 1.3.1 will be the deal.

  10. theapparatus
    Member
    Posted 16 years ago #

    I must be special. We're not seeing it and all installs are now 1.3.

  11. hhuskies
    Member
    Posted 16 years ago #

    I just upgraded to version 1.3, and it works perfectly. This is the first upgrade I have had to do using Wordpress MU since having the system, and it was flawless. Thank you, thank you, thank you once again for such an amazing system.

    And just a tip to those that are upgrading. Don't forget to include your previous .htaccess file! :) I forgot to re upload my .htaccess file and I started to panic when I was getting OBJECT NOT FOUND! errors when I tried to visit each blog. LOL. But I uploaded the .htaccess file, and everything was back to normal.

    Thanks again,

    Christian

  12. theapparatus
    Member
    Posted 16 years ago #

    I'm getting the slash issue as well with an r1181 install.

    The strange thing though is that it's only showing up on occasion and with random blogs, not all of them.

    The "new blogs getting set to private" issue appears to have magically gone away.

    It's rather strange...

  13. lunabyte
    Member
    Posted 16 years ago #

    Without looking, it could be an addslashes deal, and it being called even if the server has magic_quotes turned on (which makes addslashes unneeded, and could cause something like that).

    I have noticed on a test install with 1.3 that it is adding slashes (as escapes). Like when a title is Name's Blog, it escapes the apostrophe.

    IF the case is addslashes (or a wp function that does the same thing), then checking for magic quote being on and processing as needed would be a normal thing I'd think.

About this Topic

  • Started 16 years ago by donncha
  • Latest reply from lunabyte