The MU forums have moved to WordPress.org

New Plugin: Sitewide Dashboard Notes (44 posts)

  1. lunabyte
    Member
    Posted 17 years ago #

    Sure. ;)

  2. jalien
    Member
    Posted 17 years ago #

    I've just updated from 1.2.1 to 1.2.4 and although dashboard notes is active in the admin panel, the notes won't update. When I add a new note, it shows in the admin panel, with a new box for another note. If I type in a second note, the first disappears. It doesn't seem to save in the database. If I login as a regular user, the $tl_txt['no_notes'] message is there. Are there any changes in 1.2.4 (or 1.2.5, I'll need to update later) that could be causing this? Thanks in advance.

    edit: I found tl_notes in the database with the correct the lastest note in it, but this is not being displayed.

  3. lunabyte
    Member
    Posted 17 years ago #

    Hmmm, interesting.

    I'll have to add that to my list of things to look at with 1.2.5/1.2.5(a). I will note that I don't recall anything specific sticking out in my head as an issue with 1.2.4 either.

    Nothing sticks out off the top of my head, although there is always the possibility for one of the checks to come back false or something if it were changed.

  4. SteveAtty
    Member
    Posted 17 years ago #

    it does it with 1.2.5(a) as well. Actually the old notes just dont display at all..

    Getting this in my php error log when you try to add a note

    [12-Sep-2007 10:11:46] PHP Fatal error: Cannot use string offset as an array in /webstuff/wp-content/mu-plugins/mu-dashboard-notes.php on line 66

    line 66 is

    if ( wp_specialchars($note) == wp_specialchars($tl_notes['notes'][$time]) ) {

    Re-edit to add.

    If I do a var_dump($tl_notes); right before the

    if ( !empty($tl_notes['notes']) && is_array($tl_notes['notes']) ) {

    if comes back with the following:

    string(604) "a:3:{s:9:"installed";b:1;s:7:"version";s:4:"1.0a";s:.....

    So of course it isn't an array so it stops!

  5. SteveAtty
    Member
    Posted 17 years ago #

    OK I've fixed it... not sure what happened though, I suspect it might be the update script that updates the blogs.

    If you delete the row from wp_sitemeta for tl_notes then it works fine

  6. jalien
    Member
    Posted 17 years ago #

    I tried deleting the table (I tried that earlier, but thought I might have somehow made a mistake so I tried again) and still have the same result. The new note is stored in the database, but doesn't show up in the blogs. Just like before. I'll try later and see if I get the same string result as SteveAtty.

  7. SteveAtty
    Member
    Posted 17 years ago #

    If you delete the row out of the table you have to make sure that you've closed all your windows down or the "bad" data is held in the global variable and the problem will continue

    Something in the blog upgrade process seems to change the text so that when you run unserialize it can't convert the string into an array so when you fetch it from the Database it comes back as a string.

  8. lunabyte
    Member
    Posted 17 years ago #

    That's very strange, Steve. Very strange indeed.

    Thanks for noting a fix though, and that the problem doesn't appear to be within the plugin itself.

    // side note:

    I might add in a quick feature that does a complete reset of the data, to prevent further problems. Since my time is pretty much booked solid for the next 8-10 weeks, it might be a while though.

  9. SteveAtty
    Member
    Posted 17 years ago #

    Something is not quite right.

    I restored a copy of wp_sitemeta into another table. I copied the contents of the tl_notes record over. All notes show fine.
    I added a new note - clicked on Update. New Note appears.

    I can add more new notes, I can partially edit existing notes by adding text to them. But if I try to remove any text then it goes wrong and throws the String Offset error.

    So it works fine as long as you never try to remove a note or remove text from a note.

    Re-edited to add:

    If I disable caching it works fine!

    Re-Re-edited to add:

    No it doesn't. Seems to be completely random. Something somewhere is not serializing/unserializing properly

  10. SteveAtty
    Member
    Posted 17 years ago #

    Well I've spent more time playing with it.

    You have to keep hopping on and off the dashboard page to get the error to crop up.

    It seems to be if you have quotes in your text its not escaping/unescaping them properly.

    The DB contains:

    a:3:{s:9:"installed";b:1;s:7:"version";s:4:"1.0a";s:5:"notes";a:2:{i:1189621984;s:10:"note \"a\"";i:1189621911;s:6:"note 1";}}

    The returned data from get_site_option('tl_notes') is :
    string(124) "a:3:{s:9:"installed";b:1;s:7:"version";s:4:"1.0a";s:5:"notes";a:2:{i:1189621984;s:10:"note "a"";i:1189621911;s:6:"note 1";}}"

  11. jalien
    Member
    Posted 17 years ago #

    Thanks for the investigations. I did have quotes in notes (links). Its working now without any links, but that is certainly better than nothing at all. Again, thanks so much to both of you for the help.

  12. suleiman
    Member
    Posted 17 years ago #

    hmmm....I was planning on rolling out 1.2.5 sometime soon. Bummer I'll have to get rid of this lovely plugin :(

  13. cmichaelpatton
    Member
    Posted 17 years ago #

    I have this loaded to the wordpress mu plugin folder and it is not showing up anywhere. Where is it supposed to be found on the admin panel? It is not in the plugin activation area. Any clue?

  14. lunabyte
    Member
    Posted 17 years ago #

    You put it in mu-plugins, so no, it won't show up on the plugins menu.

    Look on your dashboard, on the right hand side...

About this Topic

  • Started 18 years ago by lunabyte
  • Latest reply from lunabyte