1
dejadingo
unserialize() error in kernel/object.php
  • 2006/2/22 23:48

  • dejadingo

  • Just popping in

  • Posts: 71

  • Since: 2004/10/22


I'm using XOOPS 2.2.4 (on my test site for now) - I really need the excellent upgrade to the Admin side, themes, etc.

I can see the cause of this error - there are at least 2 places where the the options array for the "umode" form select field are specified incorrectly. I changed them, but I can't get the change reflected in the database when I update the System and Profiles modules. The umode field in the xoops_user_profile_field table still shows its options to be "Nested,Flat,Threaded" instead of an Array.

From the change log, it looks like the failure to update the profile config options from the system config options was expected to be resolved, but it doesn't seem to be a complete solution.

If someone can tell me how to get the database to update, I'll post the necessary fixes.
Thanks.

2
dejadingo
Re: unserialize() error in kernel/object.php
  • 2006/2/23 2:24

  • dejadingo

  • Just popping in

  • Posts: 71

  • Since: 2004/10/22


Well, it looks like the places I thought were broken are OK, which means I have no idea what caused the problem. I fixed it, but to do so I had to manually change the value in the database.

The equivalent SQL would be

UPDATE xoops_user_profile_field
SET field_options = 'a:3:{s:4:"nest";s:6:"Nested";s:4:"flat";s:4:"Flat";s:6:"thread";s:8:"Threaded";}'
WHERE field_name = 'umode'

I would really appreciate it if someone can point out where the problem originated.
Thanks.

3
mmbridges
Re: unserialize() error in kernel/object.php
  • 2006/2/24 6:22

  • mmbridges

  • Just popping in

  • Posts: 1

  • Since: 2005/1/6 2


I too am testing XOOPS 2.2.4 on a localhost WAMP5 server.
PHP 5.1.1
Apache 1.3.33
MySQL 5.0.16-nt

When in the Extended Profiles Administration page under the "Fields" tab I get the following similar PHP error:

--------------------------------------------------------------

Notice [PHP]: unserialize() [function.unserialize]: Error at offset 0 of 20 bytes in file c:\wamp\www\xoops2.2.4\kernel\object.php line 344

---------------------------------------------------------------

I am not sure I know how to do the manual update of the database to fix the problem like you did. Do I need to make the exact same manual change that you did or might my problem be slightly different? Any help would be greatly appreciated!

Here is the point in the code where the error occurs:

-----------------------------------------------------------

case XOBJ_DTYPE_ARRAY:
if (!is_array($ret)) {
if ($ret != "") {
$ret = unserialize($ret); <-----line 344
}
$ret = is_array($ret)?$ret:array();
}

4
dejadingo
Re: unserialize() error in kernel/object.php
  • 2006/2/24 13:46

  • dejadingo

  • Just popping in

  • Posts: 71

  • Since: 2004/10/22


Hmmm ... seems to have lost my reply, trying again ...

The error you see is exactly what I had. It's a basic XOOPS problem and does not seem related to any particular version of PHP, Apache or MySQL.

If you have phpMyAdmin installed on your machine, you can try executing the SQL in my post, or you can make the change manually as I did. Simply open the xoops_user_profile_field table and browse the rows until you find the one with the value "umode" in the field-name column. Edit that row and replace the current value of the field_options column --

Nested,Flat,Threaded

with --

a:3:{s:4:"nest";s:6:"Nested";s:4:"flat";s:4:"Flat";s:6:"thread";s:8:"Threaded";}

(make sure you have everything exactly correct here, including the braces and double-quotes).

Note, however, that this is not a real fix, but only a temporary workaround. As long as there is a value in the database for the profile field, updating the System or Profiles modules should not cause the problem to reappear. But since I haven't yet found the original source of the invalid data, every new installation of XOOPS 2.2.3/2.2.4 will also need this manual workaround.

It's really fairly easy to do, but if you need more specific help using phpMyAdmin to change the database, please post back here.

5
dejadingo
Re: unserialize() error in kernel/object.php
  • 2006/2/27 17:00

  • dejadingo

  • Just popping in

  • Posts: 71

  • Since: 2004/10/22


Here's the source of the problem :
[fix]

Login

Who's Online

186 user(s) are online (109 user(s) are browsing Support Forums)


Members: 0


Guests: 186


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits