Recent Topics

1 Mar 15, 2011 10:48    

My b2evolution Version: Not Entered

Upgrade went fine I thought everything working perfect, just went to write a post, clicking "add/link files" normally brings up the file manager to upload the photos ect, just getting a blank white window. No writing at all anywhere. Anyone got any ideas? Really rely on this feature. Need to upload photos,

The folder tructure all seems ok

media/blogs/MYBLOGFOLDERS
media/shared
media/shared/global
media/users

All the above are 777 inc inside, doesnt seem to change the page just not displaying anything doesnt say any errors...help :(

2 Mar 15, 2011 12:11

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:

[Tue Mar 15 12:08:21 2011] [error] [client 80.72.196.194] PHP Fatal error:  Call to a member function get_next() on a non-object in /var/www/techblog/inc/files/files.ctrl.php on line 201, referer: http://techblog.gstlt.info/admin.php?ctrl=items&action=edit&p=3&redirect_to=%2Fadmin.php%3Fblog%3D1%26show_statuses%255B%255D%3Ddraft%26orderby%3Ddatemodified%26comments%3D5%26show_past%3D1%26show_future%3D1%26posts%3D5%23item_3

When you enable displaying errors in php, you'll get in pop-up window:

Fatal error: Call to a member function get_next() on a non-object in /home/demo1b5/public_html/stable/inc/files/files.ctrl.php on line 201

One can check it out at b2 demo site.

Cheers!

3 Mar 15, 2011 12:14

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

4 Mar 15, 2011 13:17

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?

5 Mar 15, 2011 13:50

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!

6 Mar 15, 2011 14:04

A quick workaround:

  1. Save your new post as a draft

  2. Go to Posts/Comments

  3. Find your new post and click Files...

  4. You can now upload and link uploaded files to your new post

  5. Voila![/list:o]

  6. ps. Code I mentioned with my previous post returns NULL. Looking forward to fix that. Force is strong in B2 ;)

7 Mar 15, 2011 14:12

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?

8 Mar 15, 2011 14:52

Yeah the post has to already be saved anyway, still just popping up blank page

9 Mar 15, 2011 14:57

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

www.bitsnacker.com

Cheers again, totally stuck here

10 Mar 15, 2011 15:13

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: testing

www.bitsnacker.com

Cheers 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.

11 Mar 15, 2011 15:19

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

12 Mar 16, 2011 15:57

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?

13 Mar 16, 2011 16:22

Yeah hope there is a fix shortly, my knowledge of PHP is not too good

14 Mar 19, 2011 04:38

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

15 Mar 19, 2011 19:44

Lol changed that its now worse, add/link files isnt even 'clackable' now wont open the popup at all

16 Mar 19, 2011 19:45

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() ).'/';
}
}

17 Mar 19, 2011 19:49

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() ).'/'; 
    } 
} 

18 Mar 20, 2011 07:17

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() ).'/'; 
    } 
	} 
}

19 Mar 20, 2011 11:09

OK il try that, noticed it still is not clickable on writing new posts only when editing saved posts

20 Mar 20, 2011 11:12

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

21 Mar 20, 2011 19:21

Thanks a million! That fixed the problem. Cheers!

22 Mar 20, 2011 19:31

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.

23 Mar 20, 2011 19:43

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

24 Mar 20, 2011 19:48

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?

25 Mar 20, 2011 20:00

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.

26 Mar 20, 2011 20:57

Not sure what you mean from the cache

This only happened strait after the update to 4x

27 Mar 22, 2011 06:59

Doublecheck that the file extension is .php.

28 Mar 22, 2011 23:22

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?

29 Mar 24, 2011 10:29

Can confirm this is now working, not sure what i done wrong the last time round :)

Cheers for all the help


Form is loading...