mirror of
git://develop.git.wordpress.org/
synced 2025-04-11 07:37:17 +02:00
Instead of silently failing when attempting to insert a value into a field, this commit saves the error in the `wpdb::$last_error` property. Sets `last_error` with an error message if: * `wpdb::query()` fails for invalid data * `wpdb::process_fields()` fails to process the value(s) for the field(s) where the value could be too long or contain invalid data Sets `last_query` if `wpdb::query()` fails for invalid data. If `__()` is not available, uses non-translated error message to ensure the error is captured. There is no change to wpdb aborting when an error occurs. Adds tests. Props dlt101, mnelson4, dd32, pento, hellofromTonya, davidbaumwald, sergeybiryukov, johnbillion, swissspidy, datainterlock, anandau14, anthonyeden, asif2bd, audrasjb, chaion07, dpegasusm, fpcsjames, galbaras, jdgrimes, justindocanto, kwisatz, liammitchell, lucasw89, lukecarbis, nettsite, nlpro, procodewp, psufan, richardfoley, skunkbad, travisnorthcutt, woodyhayday, zoiec. Fixes #37267. git-svn-id: https://develop.svn.wordpress.org/trunk@52176 602fd350-edb4-49c9-b593-d223f7449a82