Delete permanently or empty trash - Notice wpdb::prepare

Support MB Relationships Delete permanently or empty trash - Notice wpdb::prepare

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #32047
    JulienJulien
    Participant

    Hello,

    I have a Notice on debug mode when I want to delete permanently a post type.

    PHP Notice: wpdb::prepare was called <strong>incorrectly</strong>. The query does not contain the correct number of placeholders (2) for the number of arguments passed (3). Please see <a href="https://wordpress.org/support/article/debugging-in-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 4.8.3.) in /var/www/html/web/wp/wp-includes/functions.php on line 5663

    The problem located at ...\plugins\meta-box-aio\vendor\meta-box\mb-relationships\inc\database\storage-handler.php at line 104.

    https://pastebin.com/0KvVqu78

    if $target, we have two args and if not we have 3 args.
    So if we have in the case $target isn't false or null, we have 2 args and wpdb::prepare have each time 3 args in addition of $sql.

    I tried an hotfix like that

    https://pastebin.com/dVjzaGq6

    With that fix, the notice disappear.

    Could you fix that on next update ? In production isn't a real problem but in development, I have all the time the error when I want to delete permanently one or multiple posts.

    Thanks

    #32048
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Thank you for your feedback.

    I've escalated this issue to the development team to fix it in the next update.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.