Comments (6)
@gerb-ster I can't recall but was this related to the #46 ?
from approval.
No, this is something else I'm afraid.
It has to do with this line:
approval/src/Concerns/MustBeApproved.php
Line 98 in d7a1300
The function json_encode is called to json encode the dirty attributes. But if one of those attributes is of the type 'array' it gets double json encoded.
After approval the new_data is converted back to an array on this line:
approval/src/Scopes/ApprovalStateScope.php
Line 107 in d7a1300
and that way you will end up with a json string instead of an array.
I'll open an bugfix-branche and add a test to expose this issue.
from approval.
I've added a test which shows the issue
https://github.com/gerb-ster/approval/tree/bugfix_array-attributes
from approval.
Hmm,
I had a quick glance as I had some time. I thought it might be to do with the fact that I am casting new_data
and original_data
in the Approval
model already, as well as encoding it elsewhere, so thought that might be why it is double encoding, but that doesn't seem to be the case as the test still fails 🤔
I can't seem to spot a solution just yet, so if you're able to help out further that'd be great as it does seem like something that could be an issue later, I just haven't had the time lately to focus on Open Source stuff.
Thanks!
from approval.
@cjmellor Sure, I'll have a look later today!
from approval.
Closed by #47
from approval.
Related Issues (9)
- updateApprovalState Updating All Rows in the Approval Table HOT 3
- Bug: ```Approval::reject()``` rejects all pending approvals instead of one specific approval HOT 1
- WithoutApproval not working on create model HOT 2
- Problem with ide-helper generator HOT 2
- Approval fails for models with a morphMap HOT 2
- approvalable_id not save HOT 1
- No operator matches the given name and argument types. You might need to add explicit type casts. HOT 2
- approvalModelExists() MySQL bug HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from approval.