Error: Creating default object from empty value

Phoca Download - download manager
arwi
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 06 Jan 2013, 21:24

Error: Creating default object from empty value

Post by arwi »

Hi,

Phoca download is a great component.
However, since switching to php 5.4.10 from php 5.2 (Joomla 2.1.8, phoca download 2.1.8) I get the following error message when trying to upload a file from the frontend:

Code: Select all

Warning: Creating default object from empty value in /homepages/12/d30400693/htdocs/joomla/j25/administrator/components/com_phocadownload/helpers/phocadownload.php on line 191
Has anyone experienced this problem, too or knows how to solve it?
Any help appreciated.

Regards
Arnd
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48587
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Error: Creating default object from empty value

Post by Jan »

Hi, I will change it for next release (the code is older than new changes in PHP).

For now you can quick fix it if you will define the object, add before line 191:

$variable = new StdClass(); (you need to set the right variable which caused the problem)

Jan
If you find Phoca extensions useful, please support the project
hochrheinwebservice
Phoca Newbie
Phoca Newbie
Posts: 1
Joined: 15 Jan 2013, 04:03

Re: Error: Creating default object from empty value

Post by hochrheinwebservice »

I do the 'quick fix' and there is no error massage!

But the new problem is, i can't now choose any category? Before the 'quick fix', i can choose all!

Any Idea? THX
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48587
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Error: Creating default object from empty value

Post by Jan »

Hi, do you get some error message?, did you add it to right place (e.g. before foreach to not reset the values every time the loop is done) :idea:

Jan
If you find Phoca extensions useful, please support the project
arwi
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 06 Jan 2013, 21:24

Re: Error: Creating default object from empty value

Post by arwi »

Hi Jan,

my Java knowlwdge is nearly non-existing.
I have tried to insert the suggested statement (using the variable name which is likely to cause the error) but the error is still there (only the line number of the error has increased due to the new statement.
I have inserted the statement before the loop.

Any help appreciated.

Thanks!
Arnd.
adular
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 08 Feb 2013, 20:05

Re: Error: Creating default object from empty value

Post by adular »

Hi
I have the same problem
"Warning: Creating default object from empty value in /homepages/.../administrator/components/com_phocadownload/helpers/phocadownload.php on line 191"

Joomla Version 2.5.8 Stable
Phoca Download Version 2.1.8
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48587
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Error: Creating default object from empty value

Post by Jan »

Hi, thank you for the info, I will change the behaviour of next version of Phoca Download so it will work without warnings under php5.4

Jan
If you find Phoca extensions useful, please support the project
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48587
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Error: Creating default object from empty value

Post by Jan »

Hi, fixed in 2.1.9

Jan
If you find Phoca extensions useful, please support the project
Post Reply