WordPress.org

Ready to get started?Download WordPress

Forums

Document Gallery
[resolved] Error After Update (13 posts)

  1. wtfbingo
    Member
    Posted 10 months ago #

    I updated the plug-in recently and am getting this error:

    Warning: array_diff_key() [function.array-diff-key]: Argument #1 is not an array in /home/content/90/11491890/html/abatinoaklandwp/wp-content/plugins/document-gallery/models/class-gallery.php on line 46

    http://wordpress.org/plugins/document-gallery/

  2. Dan Rossiter
    Member
    Plugin Author

    Posted 10 months ago #

    Well, I'm baffled. I'm looking at the source of the error and as far as I can tell it shouldn't be a problem.

    I do have one idea that might resolve it, but first I want to try and reproduce the issue on my install. Can you give me a bit of information?

    • What shortcode attributes are you using? ([dg ...])
    • What version of WordPress are you running?

    -Dan

  3. Dan Rossiter
    Member
    Plugin Author

    Posted 10 months ago #

    Scratch that. Apparently the Shortcode API passes an empty string if no arguments are used in the shortcode, which was breaking logic that was expecting the return value to always be an array.

    I've written a solution and it will be pushed out within the hour.

    Thanks for pointing this out!
    -Dan

    EDIT: Solution is released and you should be able to upgrade to 1.4.1 as soon as the WP system pushes it out.

  4. wtfbingo
    Member
    Posted 10 months ago #

    I'm afk right now (so 1997 of me lol) so I can't get the exact info you need, but I know that it definitely was a straight forward use of the [dg] shortcode.

    Thanks for the plug-in and the fix!

  5. Dan Rossiter
    Member
    Plugin Author

    Posted 10 months ago #

    My pleasure!

    If everything works out, it'd be great if you could rate the plugin so others can find it.

    -Dan

  6. wtfbingo
    Member
    Posted 10 months ago #

    Great! Will-do!

  7. wtfbingo
    Member
    Posted 10 months ago #

    Now nothing shows.

    The page where it is is password protected, so I can't show an example. I'm placing [dg][/dg] around the document links, which worked before the initial update.

  8. Dan Rossiter
    Member
    Plugin Author

    Posted 10 months ago #

    That's very interesting. It's not working because that's not the propper usage of the shortcode, but I'm intrigued that it worked before...

    Check the installation page for usage directions, but you don't need a [/dg] tag.

    Let me know if you have any other questions after you take a look at the installation page.

    -Dan

  9. kylegilbert
    Member
    Posted 7 months ago #

    Dan, any time I attempt to pass an attribute, I receive an error. For instance:

    localpost=false is not a valid term name in 0.

    Can you help me with this?

  10. Dan Rossiter
    Member
    Plugin Author

    Posted 7 months ago #

    Hi Kyle,

    Can you check a few things for me? What version of the plugin are you using? That reminds me of a couple of issues that were resolved previously. The other thing is, can you give me a full example of a shortcode your're using? Context may be important to figuring out what's going on.

    Thanks!
    -Dan

  11. Sean
    Member
    Posted 6 months ago #

    @Dan, I too receive an error:

    Warning: array_key_exists(): The first argument should be either a string or an integer in ********\wp-content\plugins\document-gallery\models\class-document.php on line 140

    This error is present only when NOT logged in and, interestingly, appears before my main post content. The document gallery still appears where I've inserted the dg shortcode: [dg orderby="menu_order"] within the content of my post.

    I'm running WP 3.8 on a localhost install, Version 1.4.1 of Document Gallery plugin.

    Also, if this has any relevance, the icon displayed for the document type .htm is DIFFERENT when logged in vs. logged out. I thought that is odd. The other filetypes I have displayed don't change icons when logged in or out.

    Logged in icon displayed for .htm file: /wp-content/plugins/document-gallery/icons/html.png
    Logged out icon displayed for .htm file: /wp-includes/images/crystal/code.png

    Finally, this error is printed five times, which is the number of documents in the gallery with the .htm filetype. I am not seeing this error on other pages or posts using the [dg] shortcode where there is not a .htm file in the gallery (though I haven't tested out on other doc types).

  12. Dan Rossiter
    Member
    Plugin Author

    Posted 6 months ago #

    Sean,

    Thanks for the added detail. I'm looking into this tonight and plan to have a patch out within the day.

    -Dan

  13. Dan Rossiter
    Member
    Plugin Author

    Posted 6 months ago #

    Sean,

    I've just pushed up version 1.4.2, which I believe will resolve your problems.

    Please let me know if the problem persists or if you notice any other issues.

    Thanks!
    -Dan

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.