Closed Malraoosh closed 7 years ago
Hey, thanks for the report - there was an error. We used array + array
instead of array_merge(...)
.
I'm waiting for the travis results https://travis-ci.org/fenos/Notifynder/builds/237438986 and if everything is fine I will merge and tag the fix with v4.2.1
.
To prevent something like this I've added some more unittests that should cover this error:
\NotificationTest::testFillablesEmpty
\NotificationTest::testFillablesCustomFillables
\NotificationTest::testFillablesCustomRequired
\NotificationTest::testFillablesCustom
\ConfigTest::testGetAdditionalFields
\ConfigTest::testGetAdditionalFieldsFillable
\ConfigTest::testGetAdditionalFieldsRequired
\ConfigTest::testGetAdditionalFieldsEmpty
Tell me when it's done
https://github.com/fenos/Notifynder/releases/tag/4.2.1 All tests passed - so it should work now.
Thanks
Can you pls give feedback if this solved your issue or not!?
Yes it dose, thanks for your help 👍
Hello, I tried to add custom fields to the notifications table, but when i tried to set them using
setField
method it didn't work.I dig in to your code and i found that the
mergeFillables
invendor/fenos/notifynder/src/Notifynder/Models/Notification.php
thegetCustomFillableFields
didn't get merged with thegetFillable
.I am using V4.1 and this is the result of
getFillable
andgetCustomFillableFields
functionsgetFillable
returnsarray:10 [ 0 => "to_id" 1 => "to_type" 2 => "from_id" 3 => "from_type" 4 => "category_id" 5 => "read" 6 => "url" 7 => "extra" 8 => "expires_at" 9 => "stack_id" ]
getCustomFillableFields
returnsarray:4 [ 0 => "from_type" 1 => "to_type" 2 => "message_en" 3 => "message_ar" ]
and the final result
mergeFillables
functionarray:10 [ 0 => "to_id" 1 => "to_type" 2 => "from_id" 3 => "from_type" 4 => "category_id" 5 => "read" 6 => "url" 7 => "extra" 8 => "expires_at" 9 => "stack_id" ]