-
Notifications
You must be signed in to change notification settings - Fork 11.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Queue Fails to Create Payload with Invalid Characters in Data #12194
Comments
Ping @taylorotwell. |
@JamesGuthrie |
The result of
The class which handles the UUID doesn't have any public fields, which is why it's empty here. The attribute methods, within the
And this is the library referenced: Rhumsaa\Uuid |
I don't understand why the // Generate a version 1 (time-based) UUID object
$uuid1 = Uuid::uuid1();
echo $uuid1->toString() . "\n"; // i.e. e4eaaaf2-d142-11e1-b3e4-080027620cdd
// Generate a version 3 (name-based and hashed with MD5) UUID object
$uuid3 = Uuid::uuid3(Uuid::NAMESPACE_DNS, 'php.net');
echo $uuid3->toString() . "\n"; // i.e. 11a38b9a-b3da-360f-9353-a5a725514269
// Generate a version 4 (random) UUID object
$uuid4 = Uuid::uuid4();
echo $uuid4->toString() . "\n"; // i.e. 25769c6c-d34d-4bfe-ba98-e0ee856f3e7a
// Generate a version 5 (name-based and hashed with SHA1) UUID object
$uuid5 = Uuid::uuid5(Uuid::NAMESPACE_DNS, 'php.net');
echo $uuid5->toString() . "\n"; // i.e. c4a760a8-dbcf-5254-a0d9-6a4474bd1b62 |
Ping @jamesmirvine ? |
For certain scenarios, storing the |
What is a solution @jamesmirvine ? |
The simplest way is to create a new object with only those fields which are required. |
Thank's for answer me. I'm doing the same. :D |
I have an eloquent Model with a 16 bit UUID attribute. When represented as a UTF-8 string, it contains malformed characters, which is expected. I use the attribute getter/setters to transform the UUID into the 36 character readable string, but when passed into the closure of a Mail::queue it causes
json_encode
to fail inside of\Illuminate\Queue\Queue::createPayload
. This results in aReflectionException
.Relevant json_encode error message:
json_last_error_msg => "Malformed UTF-8 characters, possibly incorrectly encoded"
Hiding the attribute in the Model doesn't having any affect on the serialized data string, since the entire object is serialized including the
$original
array.I can get around this by passing just the subset of the Model data that is needed for the mail, but perhaps there's a better way of handling this in the framework?
The text was updated successfully, but these errors were encountered: