WordPress.org

Ready to get started?Download WordPress

Forums

Proper Network Activation
Bug with the AJAX-Response-SQL (4 posts)

  1. markusrichert
    Member
    Posted 2 years ago #

    Just found out that the SQL-Query in the AJAX-Response does not capture all blogs if there are some with an identical registration time. It just finds the one with the lowest ID and skips the others.
    Might be minor, but it is possible that there are two blogs registered in the same seconds, especially if a blog has been copied as a template. :-)

    http://wordpress.org/extend/plugins/proper-network-activation/

  2. scribu
    Member
    Plugin Author

    Posted 2 years ago #

    The query orders the blogs by registration date, yes, but it gets all them, 5 at a time.

    The only one it excludes is the main blog, under the assumption that the activation hook is automatically run there. Maybe that's not the case?

  3. markusrichert
    Member
    Posted 2 years ago #

    Hi scribu,

    maybe I wasn't precise enough.
    It took me some time to get behind this bug. But really: It is your SQL statement, especially the order by clause. It does not see more than one blog entry with an identical registration timestamp.

    Additionally after long search I found a big logic bug with the deactivation:
    There is no way to call the deactivating functions of a plugin in an ajax call AFTER deactivating the plugin network wide. The plugin is then simply no more in the list to be included in wp-settings.
    Maybe it might work to do the network wide deactivation on 'done'-status and skip it before. I'm testing around and your ideas are welcome.

    Anyway, I appreciate your work. Thanks a lot!

    Regards, Markus

  4. scribu
    Member
    Plugin Author

    Posted 2 years ago #

    But really: It is your SQL statement, especially the order by clause. It does not see more than one blog entry with an identical registration timestamp.

    Then that means there's a bug in MySQL itself. The ORDER BY statement shouldn't have any effect on which rows are returned, just on the order.

    Which version of MySQL are you running?

    There is no way to call the deactivating functions of a plugin in an ajax call AFTER deactivating the plugin network wide.

    Huh; I'll look into that.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic