-
Bug
-
Resolution: Won't Fix
-
Minor
-
3.0.9
-
None
-
PHP 5.2.6, MySQL 5.0.67, OPER 11.50
In /includes/acp/acp_bbcodes.php upon trying to add a new custom BBCode you encounter this block of code:
if ($bbcode_id > 1511)
|
{
|
trigger_error($user->lang['TOO_MANY_BBCODES'] . adm_back_link($this->u_action), E_USER_WARNING);
|
}
|
- Why 1511 if the column datatype is (for MySQL) TINYINT(3) and thus could never go beyond 999?
- Why not having a datatype (for MySQL) of i.e. MEDIUMINT(8)? Because:
- Consider the user (or the installation of a MOD or several DB restorations) having inserted a couple of custom BBCodes and then delete them again: those IDs are lost and won't be re-used ever. Thus, once the user hits this 1511 limit he can't do anything about it anymore.
- This problem has risen in this phpBB Support topic and I think it can be solved only by changing the PHP file and augmenting the database table column datatype.
Since that did not really solve the problem (it's only a workaround and in a distant future the same problem will be encountered again), the PHP code needs to be modified. I think the best idea would be to:
- SELECT all BBCode IDs, so you have a list of existing ones
- Count from NUM_CORE_BBCODES+ 1 upwards until you have an ID which is not in that list
- Serve this ID when INSERTing the dataset.
That way native BBCodes aren't touched and the ID of existing custom BBCodes is not needed anymore for examining a questionable MAX() approach
- depends on
-
PHPBB-13796 Revamp the BBCodes ACP
- Closed
- duplicates
-
PHPBB-7778 Increase limit of custom BBcodes
- Closed