I upgraded from 1.0.10 to 1.1.2 and now updated to 1.1.3. I can't upload any avatar, I get the message:
safe_unserialize: unknown/malformed type: /
No avatar, even old ones, is shown anymore since the upgrade. Can anyone help?
Edit: Same error appears when trying to post...
As a quick thought, double check what you have entered for avatar directory and url
Looks alright.
Oops, the same error appears when I try to post something. :o
Edit: Strange is, in mobile view avatars are there and I can post, but not in desktop view. :o Something with my css?
It should not be your css ... unserilaize is mostly used to unpack values stored in $modSettings The
\ seemed like a path item which is why I said to double check the avatar thing.
Since you are in maintenance mode, can you edit the file sources/ext/serialize.php
throw new \Exception('safe_unserialize: unknown/malformed type: '.$type);
throw new \Exception('safe_unserialize: unknown/malformed type: '.$type.' string: '.$str);
so we can see the value that its failing on .. that may give us an idea of where in the ACP to look.
safe_unserialize: unknown/malformed type: / string: /www/htdocs/xyz/hp_elkarte/attachments
Okay, it has to do with the attachments or avatars, it seems. I can't open the attachments settings inside ACP because of the error message. I only can open the avatar settings page. What I can is access the database itself and look (and edit) paths there.
Mostly likely the attachmentUploadDir variable in the _settings table ... what is in there?
You can also use repair_settings.php to fix url and path.
@ahrasis I did directly after the upgrade. Everything seems to work but this.
@Spuds I will check it later, I am at work now.
/www/htdocs/xyz/hp_elkarte/attachments
Looks correct.
Also:
avatar_directory: /www/htdocs/xyz/hp_elkarte/avatars
avatar_url: https://forum-alternative-antriebe.de/avatars
Looks good too.
In /sources/ext/serialize.php change:
} catch(Exception $e) {
to:
} catch(\Exception $e) {
https://github.com/elkarte/Elkarte/issues/3192
Sorry, same error message. :(
Humm and Humm ... well if that is whats in there, its not going to unserialized since its not serialized to start with.
I'm not sure if thats an upgrade issue or another bug. Change the value in your db to be
a:1:{i:1;s:38:"/www/htdocs/xyz/hp_elkarte/attachments";}
and is should stop the error being thrown, but we still need to figure out why its trying to unserialize a string value
the s:38 is the
exact number of characters ... so when you enter the real value instead of xyz , you need to adjust that up/down as needed.
@Jorin there are two instances of the code I suggested to replace, did you replace both of them?
Oh, no, only the first... I will try to replace the second also later.
My upload directory in the ACP attachments settings is missing! How's that even possible during an upgrade? I fixed this and changed the two codes back to:
} catch(Exception $e) {
...and now I can post again and change my avatar. Seems okay now.
Thanks for your help!
Let's see if it works. O:-)