2 gstlt Mar 15, 2011 12:11

any easy ways to roll back to 3.3.3? lol, cant afford to have any downtime, no idea what to do with this but itys a very important feature for my posters, www.bitsnacker.com
Ok have noticed I can access the file manager from the top bar no probs just not when writing posts, which is the most important aspect of it lol
Please someone have any clues?
I haven't been digging through code yet (and I don't have time for this right now) but I see what probably happened here.
$FileList = $edited_Item->get_attachment_FileList( 1 );
// Get first file:
/**
* @var File
*/
$File = & $FileList->get_next();
$edited_Item->get_attachment_FileList( 1 );
didn't returned class.
Hopefully someone with stronger knowledge how things work here will release a quick fix here. I'll be able to debug more later.
I'll let you know if I have working solution before official fix. Have patience. Cheers!
A quick workaround:
Save your new post as a draft
Go to Posts/Comments
Find your new post and click Files...
You can now upload and link uploaded files to your new post
Voila![/list:o]
Correct me if I'm wrong, but I thought we've always had to save a new post before you were able to link/attach files to them?
Yeah the post has to already be saved anyway, still just popping up blank page
OK if someone wants to log into my blog and see what im talking about, try and write a draft post, clicking add/link files to add images or whatever, ive created a testing account
username: test
password: testing
Cheers again, totally stuck here
go3asy wrote:
OK if someone wants to log into my blog and see what im talking about, try and write a draft post, clicking add/link files to add images or whatever, ive created a testing account
username: test
password: testingCheers again, totally stuck here
Hi
I've created new post and successfully linked a file to it as I described below. It does work but not in a usual way. Draft title: testdraft (gstlt). Pass this information to your users and let them link files around until we receive fix.
Did the file manager show up for you? I dont link files i upload then place them into the post, so the upload manager coming up blank is no good
go3asy wrote:
Did the file manager show up for you? I dont link files i upload then place them into the post, so the upload manager coming up blank is no good
No it didn't. You need to find a post you want to include files (while under Posts/Comments on top menu) and click "Files...". You'll be redirected to file manager where you can upload and link files without error.
Still waiting for a fix. Someone had time to debug this?
Yeah hope there is a fix shortly, my knowledge of PHP is not too good
Lines 196-208 in inc/files/files.ctrl.php should read
if( $FileList = $edited_Item->get_attachment_FileList( 1 ) )
{ // Get first file:
/**
* @var File
*/
$File = & $FileList->get_next();
if( !empty( $File ) )
{ // Obtain and use file root of first file:
$fm_FileRoot = & $File->get_FileRoot();
$path = dirname( $File->get_rdfs_rel_path() ).'/';
}
}
This problem has already been fixed in CVS
Lol changed that its now worse, add/link files isnt even 'clackable' now wont open the popup at all
Currently it says
$FileList = $edited_Item->get_attachment_FileList( 1 );
// Get first file:
/**
* @var File
*/
$File = & $FileList->get_next();
if( !empty( $File ) )
{ // Obtain and use file root of first file:
$fm_FileRoot = & $File->get_FileRoot();
$path = dirname( $File->get_rdfs_rel_path() ).'/';
}
}
Ok i removed the { on the second line and it appears to be working. Was this a mistake? not noticed it affect anything else yet,, so the new code goes without the { on line 2...
if( $FileList = $edited_Item->get_attachment_FileList( 1 ) )
// Get first file:
/**
* @var File
*/
$File = & $FileList->get_next();
if( !empty( $File ) )
{ // Obtain and use file root of first file:
$fm_FileRoot = & $File->get_FileRoot();
$path = dirname( $File->get_rdfs_rel_path() ).'/';
}
}
I think there was a small mistake in sam2kb:s code.
There should be three } characters in the end.
The original code was:
$FileList = $edited_Item->get_attachment_FileList( 1 );
// Get first file:
/**
* @var File
*/
$File = & $FileList->get_next();
if( !empty( $File ) )
{ // Obtain and use file root of first file:
$fm_FileRoot = & $File->get_FileRoot();
$path = dirname( $File->get_rdfs_rel_path() ).'/';
}
}
And the new one should be:
if( $FileList = $edited_Item->get_attachment_FileList( 1 ) )
{ // Get first file:
/**
* @var File
*/
$File = & $FileList->get_next();
if( !empty( $File ) )
{ // Obtain and use file root of first file:
$fm_FileRoot = & $File->get_FileRoot();
$path = dirname( $File->get_rdfs_rel_path() ).'/';
}
}
}
OK il try that, noticed it still is not clickable on writing new posts only when editing saved posts
OK i still get no popup when clicking Add/link files on new posts im writing, log into my site with the test account on page 1 and have a look if you want
Thanks a million! That fixed the problem. Cheers!
gstlt wrote:
Thanks a million! That fixed the problem. Cheers!
I see that some peole have trouble with modifying php file. I think that releasing small fix in zip file (diff or modified files) would be appreciated. Just a small suggestion.
For those who are having problems with it [url=http://gstlt.info/public/b2_4.0.4_fix/files.ctrl.phps]here is a modified file[/url]. Just download it, change extension from phps to php and replace old file.
This file will be available until next b2evo release.
ps. You can diff this file against original one, you'll find only fixed code, nothing more was added.
Replaced with the above and still not opening the popup at all on initial post write. Once i save and go back in to edit it then works, although I am saving to add link files before clicking, when I save save I need to save the post browse away from it and go back in to edit the draft
Replaced with the above and still not opening the popup at all on initial post write. Once i save and go back in to edit it then works, although I am saving to add link files before clicking, when I save save I need to save the post browse away from it and go back in to edit the draft
Are you running an opcode cache that needs to be cleared?
I logged into your site and tried it. It popped up the window (once I disabled the pop-up blocker) just fine, but the new window just showed the source code for the file you downloaded from gstlt.
It exhibits the same behavior (source code only) when I save the post and go back into it.
I think you're doing something wrong, but I'm not at all sure what.
Not sure what you mean from the cache
This only happened strait after the update to 4x
Doublecheck that the file extension is .php.
go3asy wrote:
Replaced with the above and still not opening the popup at all on initial post write. Once i save and go back in to edit it then works, although I am saving to add link files before clicking, when I save save I need to save the post browse away from it and go back in to edit the draft
Hi! I've double checked and it works just fine. Can you confirm?
Can confirm this is now working, not sure what i done wrong the last time round :)
Cheers for all the help
I have the same problem. I haven't investigated it yet, but I can give you more information about this bug.
When you want to add a file/link to the post (which has not yet any files attached - it works fine if at least one file is attached), you're getting empty new window (in my configuration at least) and you can see below log in apache error.log:
When you enable displaying errors in php, you'll get in pop-up window:
One can check it out at b2 demo site.
Cheers!