2019-07-31, 02:42 PM
2019-07-31, 03:56 PM
Hello,
thanks for wanting to use my plugin.
I have no problems executing the query with MySQL. I've already seen several plugins that ignore regex. Also in the MyBB standard "Regular Expression" is not a required field. I can't understand the problem right now.
Can other users install the plugin?
thanks for wanting to use my plugin.
I have no problems executing the query with MySQL. I've already seen several plugins that ignore regex. Also in the MyBB standard "Regular Expression" is not a required field. I can't understand the problem right now.
Can other users install the plugin?
2019-07-31, 04:42 PM
I don't know but, i like your plugin and it's impossible for me using this
2019-07-31, 05:28 PM
(2019-07-31, 03:56 PM)itsmeJAY Wrote: [ -> ]I have no problems executing the query with MySQL. I've already seen several plugins that ignore regex. Also in the MyBB standard "Regular Expression" is not a required field. I can't understand the problem right now.
These can occur with MySQL's strict mode enabled, and likely with other database engines in general (MyBB also works with SQLite and PostgreSQL).
Numerous plugins, especially old ones, execute queries where some values are not explicitly provided - MySQL with strict mode disabled takes some assumptions to make them work, but this can give unpredictable results, and thus is considered unsafe (plugins should be created for compatibility with strict mode).
The
mybb_profilefields.regex
column definition dictates it must be filled (NOT NULL
), but no default value is provided, which may cause problems if the column is not present in INSERT
queries.The ACP code for Custom Profile Fields provides values for columns with no
default
value correctly.2019-07-31, 07:07 PM
(2019-07-31, 05:28 PM)Devilshakerz Wrote: [ -> ](2019-07-31, 03:56 PM)itsmeJAY Wrote: [ -> ]I have no problems executing the query with MySQL. I've already seen several plugins that ignore regex. Also in the MyBB standard "Regular Expression" is not a required field. I can't understand the problem right now.
These can occur with MySQL's strict mode enabled, and likely with other database engines in general (MyBB also works with SQLite and PostgreSQL).
Numerous plugins, especially old ones, execute queries where some values are not explicitly provided - MySQL with strict mode disabled takes some assumptions to make them work, but this can give unpredictable results, and thus is considered unsafe (plugins should be created for compatibility with strict mode).
Themybb_profilefields.regex
column definition dictates it must be filled (NOT NULL
), but no default value is provided, which may cause problems if the column is not present inINSERT
queries.
The ACP code for Custom Profile Fields provides values for columns with nodefault
value correctly.
Hello,
Thank you for the explanation. After a fresh MyBB installation Regular Expression is not a mandatory field and the predefined fields "Bio" and "Location" have no Regular Expression... or does the regex not refer to the Regular Expression?
Can I simply assign the value 0 to the regex?
2019-07-31, 07:27 PM
You might be able to resolve this by supplying an empty value to
regex
, and other problematic columns for insertion:"regex" => "",
2019-07-31, 08:42 PM
If you want the regex for SteamID feel free to use mine in my plugin.
2019-07-31, 08:47 PM
Thanks to all of you. I will build a Fix tomorrow.
But I don't understand why an empty string should fix the bug/sql error? The default value is still not set?
Greetings
But I don't understand why an empty string should fix the bug/sql error? The default value is still not set?
Greetings
2019-07-31, 10:41 PM
(2019-07-31, 08:47 PM)itsmeJAY Wrote: [ -> ]Thanks to all of you. I will build a Fix tomorrow.
But I don't understand why an empty string should fix the bug/sql error? The default value is still not set?
Greetings
It's a matter of explicitly providing values (even if they're empty strings) for certain columns:
https://dev.mysql.com/doc/refman/8.0/en/sql-mode.html
Quote:A value can be invalid for several reasons. For example, it might have the wrong data type for the column, or it might be out of range. A value is missing when a new row to be inserted does not contain a value for a non-NULL column that has no explicit DEFAULT clause in its definition. (For a NULL column, NULL is inserted if the value is missing.)
Note it's related to specific columns with properties of possible profile fields, not pre-filling fields with some content.
2019-08-02, 04:05 PM
Should be fixxed. Sorry for the delay. I didn't have much time for this plugin in the last days.
https://community.mybb.com/mods.php?acti...1&bid=4043
https://community.mybb.com/mods.php?acti...1&bid=4043