Advertisement:

Author Topic: 2.0.0 to SMF: Converting members...Wrong value type sent to the database.  (Read 21391 times)

Offline margarett

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,761
  • Gender: Male
No idea :o Can you please attach the converter and .sql file you are using?
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

Quote
Over 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Offline LeYoyo

  • Jr. Member
  • **
  • Posts: 251
I deleted everything and restart the conversion.

First I got one more time the birthdate issue, then the instant_message, but this time (don't ask me why..) it worked.
After that, I got the same issue for hide_email. Solved in the same way (I hope it's OK...)

Code: [Select]
$row['signature'] = substr(strtr(strtr($row['signature'], '<>', '[]'), array('[br /]' => '<br />')), 0, 65534);
$row['instant_messages'] = (int)$row['instant_messages'];
$row['hide_email'] = (int)$row['hide_email'];

Finally :
Code: [Select]
$row['signature'] = substr(strtr(strtr($row['signature'], '<>', '[]'), array('[br /]' => '<br />')), 0, 65534);
$row['instant_messages'] = (int)$row['instant_messages'];
$row['hide_email'] = (int)$row['hide_email'];
$row['pm_email_notify'] = (int)$row['pm_email_notify'];


Next error : Converting topics...Wrong value type sent to the database. Integer expected. (id_poll)

Can I do the same (int cast) as for the other one and at the same place ?
« Last Edit: June 14, 2014, 12:15:33 PM by LeYoyo »
Sous SMF 2.0.8

Offline margarett

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,761
  • Gender: Male
As long as it's integers, the cast works.
I just have no idea why that happens :o
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

Quote
Over 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Offline LeYoyo

  • Jr. Member
  • **
  • Posts: 251
it don't work. I cannot find where to put the cast :/ for the id_poll

Any advice ?
Sous SMF 2.0.8

Offline LeYoyo

  • Jr. Member
  • **
  • Posts: 251
Still working on the conversion. I think I'm not far from goal. After making some changes I found in different topics, now I'm blocked here...

I used [mywebfiles] to mask the real hosting url

Code: [Select]
Converting polls... Successful.
Converting poll options...
Warning: array_keys() [function.array-keys]: The first argument should be an array in [mywebfiles]/convert.php on line 1291

...  Many many of these eror lines

Warning: Invalid argument supplied for foreach() in [mywebfiles]/convert.php on line 2627

Warning: array_combine() [function.array-combine]: Both parameters should have an equal number of elements in [mywebfiles]/forum/Sources/Subs-Db-mysql.php on line 627
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 3


Any idea about this issue (at the moment, I couldn't find a way of solution)
« Last Edit: June 17, 2014, 04:15:23 AM by LeYoyo »
Sous SMF 2.0.8

Offline LeYoyo

  • Jr. Member
  • **
  • Posts: 251
I tried to jump directly to the step 10.

The conversion is reaching the end and everything works well. Except the polls of course. So as expected, This is the last issue to fix and the full conversion will be possible :)
Sous SMF 2.0.8

Offline margarett

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,761
  • Gender: Male
Can you please attach the converter you're using now?
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

Quote
Over 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Offline LeYoyo

  • Jr. Member
  • **
  • Posts: 251
Here is it.
Sous SMF 2.0.8

Offline margarett

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,761
  • Gender: Male
Please add convert.php also ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

Quote
Over 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Offline LeYoyo

  • Jr. Member
  • **
  • Posts: 251
Here is it (I didn't change it)
Sous SMF 2.0.8

Offline margarett

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,761
  • Gender: Male
I have no idea, sorry :(

Maybe you can try to use the code from emanuele's converter for 3.x in that particular topic (poll options)
Code: [Select]
/******************************************************************************/
--- Converting poll options...
/******************************************************************************/

---* {$to_prefix}poll_choices
---{
$no_add = true;
$keys = array('id_poll', 'id_choice', 'label', 'votes');
$choices = @unserialize(stripslashes($row['choices']));

if (is_array($choices))
{
foreach ($choices as $choice)
{
// Put the slashes back
$choice = addslashes_recursive($choice);

// Since we modified the poll thing, we need to stick the question in here
$pollquestion = $choice['question'];
$query = convert_query("
UPDATE {$to_prefix}polls
SET question = '$pollquestion'
WHERE id_poll = '$row[id_poll]'");

// Now that we've handled the question, go ahead with our choices and votes
foreach($choice['choice'] AS $choiceid => $label)
{
// The keys of the votes array correspond to the keys of the choice array,
// which are the ID_CHOICE values
$votes = $choice['votes'][$choiceid];

// Try to work around the multiple-questions-per-poll issue...
if(isset($current_choices[$row['id_poll']][$choiceid]))
continue;
else
$current_choices[$row['id_poll']][$choiceid] = $label;

// Finally - a row of information!
                        $rows[] = array(
                   'id_poll' => $row['id_poll'],
                   'id_choice' => $choiceid,
                   'label' => substr(addslashes($label), 0, 255),
                   'votes' => $votes,
                );
}
}
}
---}
SELECT pid AS id_poll, choices
FROM {$from_prefix}polls;
---*
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

Quote
Over 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Offline LeYoyo

  • Jr. Member
  • **
  • Posts: 251
conversion restarted. Let's see if it works.

If not, then I will try to remove all the poll tables migration. It's probably better than have just some of them migrated...
Sous SMF 2.0.8

Offline LeYoyo

  • Jr. Member
  • **
  • Posts: 251
So, conversion finished

Conversion Complete
Congratulations, the conversion has completed successfully. If you have or had any problems with this converter, or need help using SMF, please feel free to look to us for support.



But no poll options in the polls. I think I will let this like it is, as no solution is available at this time...

But I have other issues...

1. before each ' there is a \
2. in the section descriptions, I have <br /> each time the description starts a new row
3. All the letters with accents (it's a french forum) are missing.

Example :
« Last Edit: June 19, 2014, 04:14:12 PM by LeYoyo »
Sous SMF 2.0.8

Offline LeYoyo

  • Jr. Member
  • **
  • Posts: 251
accent issue solved : I had to install the french package instead of the frenchUTF8 package
Sous SMF 2.0.8

Offline LeYoyo

  • Jr. Member
  • **
  • Posts: 251
So, last update:

- I changed the < br/> and the \ manually.
- I couldn't find a solution for the poll options, so they will stay so (poll topics still visible, but no way to see the poll options)
- attachements is an issue too, but I will let them in the status they are after migration. Too much effort to do this manually.


So, everything isn't fixed, the migration is, let say, 99% OK, so thanks a lot to everybody for the help !

« Last Edit: June 23, 2014, 11:37:33 AM by LeYoyo »
Sous SMF 2.0.8

Offline margarett

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,761
  • Gender: Male
I'm glad you fixed the wrong stuff yourself and I'm sorry for not being as helpful as you'd probably expect :(

Let us know if you need further help ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

Quote
Over 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Offline LeYoyo

  • Jr. Member
  • **
  • Posts: 251
Thanks a lot for your help ;)
Sous SMF 2.0.8

Offline LeYoyo

  • Jr. Member
  • **
  • Posts: 251
After a few days to use, I have two issues.

1. During migration, all the post text that includes the '  caracter were changed to \\\'
Any idea how I could easy change all the \\\' in the messages by '  ?

2. I have several time the same error in the error log (the topicID can be different, it's not only for one topic):
http://myforum.com/forum/index.php?topic=205.0
512: loadMemberContext(): member id 2 not previously loaded by loadMemberData()
File: /myhomepages/forum/Sources/Load.php
Line: 1092


Any Idea/Help/Advice about that ?

Thanks in advance
« Last Edit: August 04, 2014, 05:36:25 AM by LeYoyo »
Sous SMF 2.0.8

Offline LeYoyo

  • Jr. Member
  • **
  • Posts: 251
Would this SQL commands in phpmyadmin work ?

UPDATE smf_messages SET body=REPLACE(body,'\\\','')

UPDATE smf_messages SET subject=REPLACE(subject,'\\\','')
Sous SMF 2.0.8

Offline margarett

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,761
  • Gender: Male
That query should work, yes ;) Backup first, just in case ;)

As for your error, can you please attach your Load.php? Did you install any MODs? I've seen some errors on that but no specific solutions. Also, please make sure you run the maintenance tasks ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

Quote
Over 90% of all computer problems can be traced back to the interface between the keyboard and the chair