Invalid strings and API::add callback Issue

Support MB Custom Table Invalid strings and API::add callback IssueResolved

  • This topic has 3 replies, 2 voices, and was last updated 1 year ago by PeterPeter.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #44629
    Nicholas CoxNicholas Cox
    Participant

    Hi

    I noticed when there is a non sanitized string or invalid string or column name etc in an array passed to \MetaBox\CustomTable\API::add that it returns false, but there is no feedback from this with errors? just 0 or 1 value.

    Is there a way to monitor this as when im working with custom tables and a custom php function i need to setup error logs based on \MetaBox\CustomTable\API::add etc.

    thanks

    Nick

    #44638
    PeterPeter
    Moderator

    Hello Nick,

    The function wpdb::insert() only returns the number of rows inserted or false. There isn't a function to handle the error if it is false. I will inform the development team to consider supporting this feature in future updates.
    Following the documentation https://developer.wordpress.org/reference/classes/wpdb/insert/

    #44647
    Nicholas CoxNicholas Cox
    Participant

    Hi Peter

    Ok thanks for letting me know. The reason I am asking is that i use Metabox for development purposes and without logging errors it makes life difficult when problem solving. I spent a few hours figuring out why the forms sometimes kept failing even though the front end forms seemed valid at the time. I know sanitization can help but not all the time.

    #45275
    PeterPeter
    Moderator

    Hello,

    There are no changes in the new version but we've updated the documentation to get the error when adding a new row.
    https://docs.metabox.io/extensions/mb-custom-table/#add

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