MyBB Community Forums

Full Version: Merge System 1.6 and SMF 1.1 attachments problem.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7
(2010-10-06, 11:57 AM)Tupsi Wrote: [ -> ]
(2010-10-06, 11:09 AM)Dylan M. Wrote: [ -> ]This is what the get_raw_filename() function does, and why there was a fix for that (provided by CaptOblivious) for databases such as yours that have a mix of the old and new schemes.

but it seems to me that this function isnt called/used correctly then, as the import error says nothing neither about an attachment ID nor and md5 hash at the end, just an error that the normal filename could not be found (which is of course correct).

btw. you ment generate_raw_filename(), didnt you? couldnt find get_raw_filename() in attachment.php



after rereading attachment.php a bit, I dont see why convert_data can return valid results with

$insert_data['filetype'] = mime_content_type($data['filename']);

at all, as so far, I was under the impression that $data['filename'] holds the real filename from the old smf db, so how would the php function mime_content_type conjure a forum filename out of it to determine the file type?

I am beginning to think that your test installations dont have that function enabled and so that part of the convert_data() never gets used.

Ill commented that out and trying to import again now.

Yes I meant generate_raw_filename() Wink

My test installs are on the same server I have your database installed on at the moment Wink

But besides that I'm honestly not sure why it would work in some instances and not others. I've converted over 30 boards from 5 different softwares at this point and that has always worked fine. Also, the php.net page on mime_content_type() is slightly misleading. The examples show just the filename, yet if you read the text it requires the full path to the file, so apparently CaptOblivious is correct in that it needs the path here. :/

This of course makes it even more weird as to why it would work on my test boards but not on your board. The only thing I can think of is that due to the low number of attachments on my test board it does throw the error, but so quickly I don't see it.
dumb idea (mine), of course I dont get the error now, but of course it doesnt change anything with the mixed up hash stuff as this part of the attachment.php only deals with the mime type, silly me...


ok, just so I dont look THAT stupid, I'll have to ask now:

$data[] is an array which has basically all collumns from a particular row from the attachment table as valid fields, so $data['filename'] gives back the original filename like Maws_down.jpg, right?

The same as $data['file_hash'] gives back the hash entry of that row and $data['ID_ATTACH'] gives back the attachment ID, right?
(2010-10-06, 02:12 PM)Tupsi Wrote: [ -> ]dumb idea (mine), of course I dont get the error now, but of course it doesnt change anything with the mixed up hash stuff as this part of the attachment.php only deals with the mime type, silly me...


ok, just so I dont look THAT stupid, I'll have to ask now:

$data[] is an array which has basically all collumns from a particular row from the attachment table as valid fields, so $data['filename'] gives back the original filename like Maws_down.jpg, right?

The same as $data['file_hash'] gives back the hash entry of that row and $data['ID_ATTACH'] gives back the attachment ID, right?

Correct, but as you know not all the filenames on disk (attach name on disk) are not stored, but are instead generated by (if it exists) the filehash, original name, and attachment ID all appended together, and by an internal hashing algorithm if the filehash does not exist.
ok, out of desperation I installed a phpbb3 board and tried out this converter

http://www.phpbb.com/community/viewtopic...#p10416685

just to have a look what they are doing.

At first glance, all attachments seemed to have moved over, so my though was, maybe you could take a peek into their code and get the magic bulp light over over your head? :-)

will try to convert that converted phphbb3 now to mybb and have a look whats left afterwards :-)

ok, they messed up the character coding, my german Umlauts are gone.
I'm hoping to have this fixed shortly Smile
I'll hope so too!

meanwhile I filled another bug report regarding the permissions to keep you occupied! :-)

(2010-10-06, 03:11 PM)Tupsi Wrote: [ -> ]I'll hope so too!

meanwhile I filled another bug report regarding the permissions to keep you occupied! :-)

I see the new post, running a test convert off your database right now, so I'll see how it goes.
hmm, interesting.

It seems now after going from

smf1 -> phpbb3 ->mybb

that the bug related to attachment screwup isnt only in the smf1 section!

As i reported above the move to phpbb3 seemed ok (besides that char conversion thingie). The test thread I opened with three attachments had them all attached and it where the right one.

Then I converted that phpbb3 to mybb and visiting the same thread again I still see that post to have three attachments, but now they are all the same!
The database again has the problem of telling me the same post_18_1167697780.attach attachment name for all three files, so naturally I can click on any, but always get the same shown.

I noticed that already.
FWIW, because I need this functionality sooner rather than later, I wrote a Python script from scratch to handle importing attachments. It's Unix specific, and a bit of a hack, but perhaps it might help shed some light on the issue, in that I can confirm my script works perfectly on the very DB that the merge system isn't?

It's a bit long, and I'm willing to entertain the idea that presenting a Python script to help fix a PHP script might not be helpful at all Wink But perhaps there is something helpful in it that y'all can use.

Pages: 1 2 3 4 5 6 7