Jump to content


Photo

SMF 2.0.X -> IPB, Custom Profile Fields


Origin topic

Converting from SMF v2.0.2 -> IPB v3.3.3, Custom Profile Fields

Error Description:
Upon converting the custom profile fields, some values are not being passed with the correct type.
mySQL query error: INSERT INTO pfields_data (`pf_title`,`pf_desc`,`pf_content`,`pf_type`,`pf_not_null`,`pf_member_hide`,`pf_max_input`,`pf_member_edit`,`pf_show_on_reg`,`pf_admin_only`,`pf_group_id`,`pf_key`) VALUES('Real name','Let everybody know what your actual name is.','','input',0,0,255,1,'',0,5,'realnam')

SQL error: Incorrect integer value: '' for column 'pf_show_on_reg' at row 1
SQL error code: 1366
Date: Friday 06th July 2012 11:18:02 PM


 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Date: Fri, 06 Jul 2012 23:18:02 +0000
 Error: 1366 - Incorrect integer value: '' for column 'pf_show_on_reg' at row 1
 IP Address: [...] - /admin/index.php?adsess=...&app=convert&module=board&section=smf
 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 mySQL query error: INSERT INTO pfields_data (`pf_title`,`pf_desc`,`pf_content`,`pf_type`,`pf_not_null`,`pf_member_hide`,`pf_max_input`,`pf_member_edit`,`pf_show_on_reg`,`pf_admin_only`,`pf_group_id`,`pf_key`) VALUES('Real name','Let everybody know what your actual name is.','','input',0,0,255,1,'',0,5,'realnam')
 .--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------.
 | File                                                                       | Function                                                                      | Line No.          |
 |----------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------|
 | .../ipb/admin/applications_addon/ips/convert/sources/lib_board.php         | [db_main_mysql].insert                                                        | 2104              |
 '----------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------'
 | .../ipb/admin/applications_addon/ips/convert/modules_admin/board/smf.php   | [lib_board].convertPField                                                     | 1585              |
 '----------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------'
 |                                                                            | [admin_convert_board_smf].convert_pfields                                     |                   |
 '----------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------'
 | .../ipb/admin/applications_addon/ips/convert/modules_admin/board/smf.php   | [].call_user_func                                                             | 90                |
 '----------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------'
 | .../ipb/admin/sources/base/ipsController.php                               | [admin_convert_board_smf].doExecute                                           | 306               |
 '----------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------'

As you can see, one of the columns (show on registration) is being passed as an empty string when it is a boolean false instead of an integer 0.

Replication Steps:
  • Fresh install IPB
  • Install Converter
  • Import SMF2 data (if not already)
  • Set one custom field from SMF to not show on registration
  • New Converter for SMF2
  • Run "Custom Profile Fields" Conversion
  • Error should occur here

Suggested Fix:
/admin/applications_addon/ips/convert/modules_admin/board/smf.php Line 1579
Find
'pf_show_on_reg'    => (bool) $row['show_reg'],
Replace with
'pf_show_on_reg'    => (int) $row['show_reg'],


System Details:
Win 7x64
Apache 2.4.2
PHP 5.3.14
MySQL 5.5.21

Status: Cannot Reproduce
Version: 1.2.3
Fixed In: 0


1 Comments

Updating Fixed In to: 0
Updating Status to: Cannot Reproduce
Updating Version to: 1.2.3

Followed your steps to the letter and I cannot reproduce this.