Incorrect integer value ” for column ‘regex’ when creating new redir
-
Tried to create a redirect on a site, got this big error message (sanitized only for the domain name):
Plugin: 3.5
WordPress: 4.9.8 (single)
PHP: 7.2.10
Browser: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.67 Safari/537.36
JavaScript: https://mysite.edu/wp-content/plugins/redirection/redirection.js
REST API: https://mysite.edu/wp-json/Error: Unable to add new redirect (29): Incorrect integer value: ” for column ‘regex’ at row 1
Action: redirection/v1/redirect/ POST
Params: {“id”:0,”url”:”/obs/data-request-instructions/”,”title”:””,”regex”:false,”match_type”:”url”,”action_type”:”url”,”position”:0,”group_id”:4,”action_code”:301,”action_data”:{“url”:”/our-research/observational-study/dian-observational-study-investigator-resources/data-request-terms-and-instructions/”}}
Code: 400 Bad Request
Raw: {“code”:”redirect”,”message”:”Unable to add new redirect”,”data”:{“status”:400,”error_code”:29,”wpdb”:”Incorrect integer value: ” for column ‘regex’ at row 1″}}The PHP error log had a more detailed copy of the error, with the full query:
[19-Oct-2018 15:13:49 UTC] WordPress database error Incorrect integer value: ” for column ‘regex’ at row 1 for query INSERT INTO
d_redirection_items(regex,url,title,group_id,position,action_type,action_code,match_type,action_data,status) VALUES (”, ‘/obs/data-request-instructions/’, ”, ‘4’, ‘0’, ‘url’, ‘301’, ‘url’, ‘/our-research/observational-study/dian-observational-study-investigator-resources/data-request-terms-and-instructions/’, ‘enabled’) made by Red_Item::createLooks like that column is expecting an integer, and the query is specifying a blank value (not a null, and not an integer).
The backing database is actually MariaDB, not MySQL, but I’ve rarely encountered an instance where that matter.
This was just while creating a fairly standard plugin, but I think this site is one where the Redirection plugin was just recently installed.
The topic ‘Incorrect integer value ” for column ‘regex’ when creating new redir’ is closed to new replies.