Giter Club home page Giter Club logo

Comments (4)

dhrrgn avatar dhrrgn commented on August 23, 2024

Making this a Bug. It was submitted by koichi h Today.

from core.

koichirose avatar koichirose commented on August 23, 2024

Commenting to be notified of changes.

from core.

jschreuder avatar jschreuder commented on August 23, 2024

I'm speculating here but I think the problem is this line: https://github.com/fuel/core/blob/develop/classes/format.php#L215

My assumption is that json_encode() will run a get_object_vars() on the Model_User object, which will return an empty array as all the properties are protected or private. The way this could be solved is by doing something like this:

// Encode as JSON
public function to_json()
{
    $data = $this->_data instanceof ArrayAccess ? $this->to_array($this->_data) : $this->_data;
    return json_encode($data);
}

Or do this by converting objects to arrays with a _from...() method that can use either get_object_vars() or the above solution.

from core.

jschreuder avatar jschreuder commented on August 23, 2024

As it currently doesn't work at all I submitted my fix, don't have the time to properly test it though.

from core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.