IPS4 importer: custom user fields imported without a title

Chris D

XenForo developer
Staff member
Affected version
1.5.latest
A customer has reported via a ticket that a recent import from IPS 4.6 has resulted in some custom fields being imported with an empty title.

This affects the custom fields listing where the cells/columns are collapsed and out of position because there is no text/description.

1634654036847.webp

In case it matters, the `field_id`s imported take the format of 1633462370_4. I'm unsure whether that is a user chosen ID, automatically generated or something we've chosen as a fallback but worth checking in case it has affected phrase creation somewhere. Alternatively, we may just be failing to get the correct language string out of the source database.
 
SQL:
SELECT ugroup.*, lang.word_custom AS g_title
                FROM core_groups AS ugroup
                LEFT JOIN core_sys_lang_words AS lang ON
                    (lang.lang_id = 1 AND lang.word_key = CONCAT('core_group_', ugroup.g_id))
                LEFT JOIN core_moderators AS moderator ON
                    (ugroup.g_id = moderator.id AND moderator.type = 'g')
                ORDER BY ugroup.g_id
word_custom needs to be replaced with word_default and used only when it is not empty .. in multiple locations
something like
SQL:
SELECT ugroup.*,  IF(LENGTH(lang.word_custom)>0, lang.word_custom, lang.word_default) AS g_title

FROM core_groups AS ugroup

LEFT JOIN core_sys_lang_words AS lang ON

   (lang.lang_id = 1 AND lang.word_key = CONCAT('core_group_', ugroup.g_id))

LEFT JOIN core_moderators AS moderator ON

   (ugroup.g_id = moderator.id AND moderator.type = 'g')

ORDER BY ugroup.g_id
 
Last edited:
Back
Top Bottom