SMF 2 to Wedge importer errors

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: SMF 2 to Wedge importer errors
« Reply #15, on February 27th, 2014, 03:12 PM »
Actually Pandos is right, board settings allow you to choose a new URL, so you might want to 'simply' visit all of your board pages again, then simply hit Save to re-generate the pretty URL. It might work.

:edit: Ninja'd! :lol:

txcas

  • Bug Zapper
  • Posts: 202
Re: SMF 2 to Wedge importer errors
« Reply #16, on February 27th, 2014, 03:38 PM »
I finally found it.  You don't see that path unless you enable Pretty URLs for boards.  I had that disabled since pretty URLs were breaking the forum.

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: SMF 2 to Wedge importer errors
« Reply #17, on February 27th, 2014, 03:59 PM »
Just what I feared!
But enabling them could also bring its lot of support requests...

txcas

  • Bug Zapper
  • Posts: 202
Re: SMF 2 to Wedge importer errors
« Reply #18, on February 27th, 2014, 04:17 PM »
Yes, I put the forum in maintenance mode and fixed all the pretty URLs for boards.  Now everything in pretty URLs is working fine!

TE

  • Posts: 286
Re: SMF 2 to Wedge importer errors
« Reply #19, on February 27th, 2014, 09:10 PM »
Quote from Nao on February 27th, 2014, 12:09 AM
message_labels is a valid members table fields in SMF 2... I don't know why it wouldn't work.

@TE, what do you think..? Is the <preparsecode> block buggy..?

Off to bed, personally.
message_labels is a field in SMF but is it still available in Wedge? If not there needs to be a
Code: [Select]
<preparsecode>
unset($row['message_labels']);
</preparsecode>
somewhere for that step.

Sorry, I'm ultra-busy at the moment, my wife's pregnant and the baby is coming soon ^_^
Thorsten "TE" Eurich - Former SMF Developer & Converters Guru

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: SMF 2 to Wedge importer errors
« Reply #20, on February 27th, 2014, 11:17 PM »
Quote from TE on February 27th, 2014, 09:10 PM
message_labels is a field in SMF but is it still available in Wedge?
Nope...
Quote
If not there needs to be a
Code: [Select]
<preparsecode>
unset($row['message_labels']);
</preparsecode>
somewhere for that step.
And it's there. Along with all SMF fields that were moved to the data field... :-/
Quote
Sorry, I'm ultra-busy at the moment, my wife's pregnant and the baby is coming soon ^_^
Hey, congratulations!
When is she due?

TE

  • Posts: 286
Re: SMF 2 to Wedge importer errors
« Reply #21, on March 2nd, 2014, 08:58 AM »
tested the importer from the wedge repo, it seems to work fine for me (at least the members import)

but I get a
Code: [Select]
Data too long for column 'can_collapse' at row 1
Did you change the can_collapse to BIT(1)?

Nao

  • Dadman with a boy
  • Posts: 16,079

TE

  • Posts: 286
Re: SMF 2 to Wedge importer errors
« Reply #23, on March 2nd, 2014, 08:51 PM »
ok, Importer seems completely broken (MYSQL strict mode) and I have no clue how to fix that..
that's the old code, which is generated from the categories SELECT

Code: [Select]
INSERT INTO `wedgem`.wedge_categories
(id_cat, name, cat_order, can_collapse)
VALUES ('6', 'Film, Fernsehen & Musik', '0', '1'),
Never worked with binary before, but reding the docs that needs to be
Quote
INSERT INTO `wedgem`.wedge_categories
(id_cat, name, cat_order, can_collapse)
VALUES ('6', 'Film, Fernsehen & Musik', '0', b'1'),
Put it in a quote just to mark the important change in red.
https://dev.mysql.com/doc/refman/5.0/en/bit-type.html
Not sure but I feel the importer would need to check the destination field in order to determine if the field is TINYINT or BIT and then modify the INSERT ..
What's the benefit of BIT(1)?  Saves a few bytes in the DB but is slower than ENUM and way more complicated than INT or TINYINT.

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: SMF 2 to Wedge importer errors
« Reply #24, on March 2nd, 2014, 10:45 PM »
I haven't heard about it being slower.
One issue with bit is that mysql doesn't accept queries where it's set as a string. But it Worked fine as a number.
Did you try replacing b'1' with just 1?

Also you're the first to find a bug with this. Maybe no one uses strict mode..?

TE

  • Posts: 286
Re: SMF 2 to Wedge importer errors
« Reply #25, on March 3rd, 2014, 11:40 AM »
That's the problem. that b'value' isn't there, but it needs to be.. (or I'm misreading the docs)
I currently get the 
Code: [Select]
Data too long for column 'can_collapse' at row 1

Did you change your database layer in order to properly support bit inserts?
https://dev.mysql.com/doc/refman/5.0/en/bit-field-literals.html
a proper INSERT would be
INSERT INTO table SET bit_field = b'1';
wheras the importer basically does this:
INSERT INTO table SET bit_field = '1';


Nao

  • Dadman with a boy
  • Posts: 16,079
Re: SMF 2 to Wedge importer errors
« Reply #26, on March 3rd, 2014, 12:42 PM »
Again, as I said, I got MySQL errors when inserting '1' values through install.sql, but I fixed that by turning them into integers.

So, a proper INSERT would also be
INSERT INTO table SET bit_field = 1;

I could simply test for is_integer() before inserting some imported data, and doing without single quotes in this case...

Or is it that can_collapse accepts more values than 0 or 1? Anything I converted to BIT(1) was thoroughly tested (AFAIK) against this possibility (a lazy habit of earlier SMF developers, I think!)

TE

  • Posts: 286

Nao

  • Dadman with a boy
  • Posts: 16,079