Love Fuel?
Donate
About
Forums
Discussions
Login
FuelPHP Forums
Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
WanWizard
a.k.a. WanWizard
Discussions
4
Comments
8242
Activity
Fuel\Core\PhpErrorException [ Notice ]: unserialize(): Error at offset 5 of 60 bytes
Ah, you were doing it in a view. Don't. First rule of MVC: logic belongs in models and (a bit less) in contollers. Views should be used for display, and should not contain any logic.
Comment by
WanWizard
April 2016
permalink
Error with DB::count_last_query() in 1.8.0
Could you try this one for me, and let me know if it works for you? $sql = preg_replace("/ORDER BY (.+?)(?=LIMIT|GROUP|PROCEDURE|INTO|FOR|LOCK|\)|$)/mi", '', $sql); We never thought about hand-coded queries when trying to come …
Comment by
WanWizard
April 2016
permalink
Fuel\Core\PhpErrorException [ Notice ]: unserialize(): Error at offset 5 of 60 bytes
add a var_dump($profile); on the line before you unserialize, so you can see exactly on which string it fails.
Comment by
WanWizard
April 2016
permalink
Fuel\Core\PhpErrorException [ Notice ]: unserialize(): Error at offset 5 of 60 bytes
Also, your error message says: unserialize(): Error at offset 5 of 60 bytes but the example you give is only 40 bytes. So there is something very wrong here...
Comment by
WanWizard
April 2016
permalink
Fuel\Core\PhpErrorException [ Notice ]: unserialize(): Error at offset 5 of 60 bytes
If that echo prints "a:1:{s:8:"fullname";s:11:"Frank Rocco";}", then I don't see why you can not unserialize it, that works fine here: Interactive shell php > $s = 'a:1:{s:8:"fullname";s:11:&quo…
Comment by
WanWizard
April 2016
permalink
Fuel\Core\PhpErrorException [ Notice ]: unserialize(): Error at offset 5 of 60 bytes
What is $item? ORM objects?, And where is this, in a view?
Comment by
WanWizard
April 2016
permalink
Fuel\Core\PhpErrorException [ Notice ]: unserialize(): Error at offset 5 of 60 bytes
Did you var_dump() that in exactly the same place that produces the error?
Comment by
WanWizard
April 2016
permalink
Error with DB::count_last_query() in 1.8.0
Created https://github.com/fuel/core/issues/1990
Comment by
WanWizard
April 2016
permalink
Fuel\Core\PhpErrorException [ Notice ]: unserialize(): Error at offset 5 of 60 bytes
What does a var_dump($item->profile_fields); show you? If you're using Auth, chances are it is already unserialized. The value itself is perfectly fine.
Comment by
WanWizard
April 2016
permalink
Access a related object with another field than id
You could use an EAV container for it, if you don't have fields in your parts table you want to query directly. An EAV container would allow you to use $my_house->window directly.
Comment by
WanWizard
April 2016
permalink
Access a related object with another field than id
That doesn't work, as you access column names, not values. And since you have a has-many relation, you can't access a direct part this way as well. You are looking for $my_house->parts[#id]->type == 'window', which is not …
Comment by
WanWizard
April 2016
permalink
Image class and bgcolor in preset
More on the list.
Comment by
WanWizard
April 2016
permalink
Watermark and padding
I understand. You're making my todo list longer and longer... ;-)
Comment by
WanWizard
April 2016
permalink
Image class and bgcolor in preset
Fixed: https://github.com/fuel/core/commit/c55321cf6f3e586a0dbdf47501e290fb27633c8c It was indeed because the watermark image uses alphablending, the insert method used imagecopymerge() does not support that, so you lost it when the watermark was c…
Comment by
WanWizard
April 2016
permalink
Image class and bgcolor in preset
Thanks. I'll try to find some time to have a look at it.
Comment by
WanWizard
April 2016
permalink
Image class and bgcolor in preset
Possible. But it could also be something in the code. I looked at the result in GIMP, and the blue outside the red is not transparent. I need to test it, because the entire image class code is new to me. Not sure if I have time for it today. Can …
Comment by
WanWizard
April 2016
permalink
Mailgun API newline
The Mailgun API expects a HTML message body, and in HTML, whitespace is not significant. So you need to format your message in HTML, or use nl2br() on the message to convert the new lines to HTML breaks.
Comment by
WanWizard
April 2016
permalink
Image class and bgcolor in preset
Just tried here, works fine, even if the watermark file itself has transparency. Try to put the watermark on after resizing, to avoid as many artifacts as possible.
Comment by
WanWizard
April 2016
permalink
Image class and bgcolor in preset
Watermarks should be semi-transparent, the default in the config is 75. The watermark image itself should not have any transparency, the watermark() function will do that for you.
Comment by
WanWizard
April 2016
permalink
Image class and bgcolor in preset
You're welcome. Took a lot longer than expected. Happy to hear you're sorted now.
Comment by
WanWizard
April 2016
permalink
Image class and bgcolor in preset
Found and fixed: https://github.com/fuel/core/commit/31209799ed0333ca8128163e585c18f41b22ab98 Fix is part of 1.9/develop.
Comment by
WanWizard
April 2016
permalink
Image class and bgcolor in preset
You should not define a bgcolor. It does what it says, it forces the bgcolor onto the image. The problem seems to be that the transparent parent image, into which the loaded image is copied, isn't transparent. I've been busy with it for o…
Comment by
WanWizard
April 2016
permalink
Image class and bgcolor in preset
Yeah, if you process them individually, they all have a red background, so the different background issue is caused by the recursive resizing.
Comment by
WanWizard
April 2016
permalink
Image class and bgcolor in preset
I think I can reproduce the problem, but I have it the other way around. If I set the bgcolor to red, the large image has a black background, the medium and small images have a red background. Also understand that these actions are cascading. So yo…
Comment by
WanWizard
April 2016
permalink
Image class and bgcolor in preset
I think I know what happens. The class first creates a transparent image with the new dimensions. It then fills the image with the background color defined (or black if bgcolor is NULL), and then sets this color as alpha, and enables transparency. …
Comment by
WanWizard
April 2016
permalink
More Comments
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Apply for Membership
About
Username
WanWizard
Joined
January 2011
Visits
2,368
Last Active
2:20PM
Roles
Administrator