Fixed Data truncated for column 'allow_post_profile' at row 17012

FloV

Well-known member
Affected version
2.2
I guess this is very similar to this bug / behaviour: https://xenforo.com/community/threads/data-truncated-for-column-user_state-at-row-888.134077/

When upgrading through CLI from 1.5.21 to 2.2 beta 3, i got the following error:

In AbstractStatement.php line 228:
xf_user_privacy: MySQL query error [1265]: Data truncated for column 'allow_post_profile' at row 17012

Exception query:

ALTER TABLE xf_user_privacy
MODIFY COLUMN allow_post_profile ENUM('members', 'followed', 'none') NOT NULL DEFAULT 'members',
MODIFY COLUMN allow_send_personal_conversation ENUM('members', 'followed', 'none') NOT NULL DEFAULT 'members'

This happened at step 20 of upgrading to 2.2.0 Alpha
 
Can you run these queries please:

SQL:
SELECT allow_post_profile
FROM xf_user_privacy
WHERE allow_post_profile NOT IN ('members', 'followed', 'none')

And:
SQL:
SELECT allow_send_personal_conversation
FROM xf_user_privacy
WHERE allow_send_personal_conversation NOT IN ('members', 'followed', 'none')

I think this is probably going to reveal that an add-on has modified the allowed values of these fields. In which case we may need to change our approach but I should be able to advise how to proceed
 
SELECT allow_post_profile
FROM xf_user_privacy
WHERE allow_post_profile NOT IN ('members', 'followed', 'none')

I got 33 results, all where allow_post_profile = 'friends'. I guess this is by the old friends AddOn by Waindigo, which i've uninstalled a long time ago.

SELECT allow_send_personal_conversation FROM xf_user_privacy WHERE allow_send_personal_conversation NOT IN ('members', 'followed', 'none')

Same! 10 results, all with the friends setting.
 
Ok. We may well still change our approach but for now this should help you:

SQL:
UPDATE xf_user_privacy
SET allow_post_profile = 'members'
WHERE allow_post_profile = 'friends'

And:

SQL:
UPDATE xf_user_privacy
SET allow_send_personal_conversation = 'members'
WHERE allow_send_personal_conversation = 'friends'
 
I got 33 results, all where allow_post_profile = 'friends'. I guess this is by the old friends AddOn by Waindigo, which i've uninstalled a long time ago.
When an add-on is un-installed, the developer should ensure that there are no traces of that add-on left (except for the files, which should be immediately deleted), and this is one example of why.
 
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.2.0 Beta 4).

Change log:
Adjust profile privacy schema changes to ensure they don't fall over with non-standard values
There may be a delay before changes are rolled out to the XenForo Community.
 
Back
Top Bottom