Giter VIP home page Giter VIP logo

Comments (4)

Mark-H avatar Mark-H commented on September 18, 2024

Because TV content is stored in a separate table, this is indeed not happening by default. We'll likely throw in a bit of magic soon to handle TVs alongside the generic resource content.

from gitify.

ahaller avatar ahaller commented on September 18, 2024

In my own branch I am successfully extracting/building all tv content. The problem appears to be with rebuilding the migx_config, migx_formtabs, and migx_formtab_fields tables from the extracted .yaml.

One issue I noticed is the handling of multidimensional arrays In GitifyBuild::buildSingleObject(). It seems I need to iterate at least one level deep in the $data array and manually convert to json any values that are arrays, for example:

foreach( $data as $key => $val ) {
    if( is_array($val) ) {
        $data[$key] = ($this->modx->toJSON($val));
    }
}

This doesn't appear to be enough to solve the problem, as there are still differences in my source modx_migx_configs table and target one. When I export my source modx_migx_configs table directly from phpMyAdmin, and import into target, it appears to work as expected (assuming the related TVs have been correctly built).

from gitify.

Mark-H avatar Mark-H commented on September 18, 2024

The latest master now has built-in support for TVs.

It may still be requiring the double json encoding because of this line: https://github.com/modmore/Gitify/blob/master/src/Command/ExtractCommand.php#L214

Pretty sure this is related to #12 as well.

The reason that line is there is to make embedded JSON a bit more editable from the files, however it's a bit tricky to undo that in the build.. there's no telling wether an array in YAML used to be JSON, or an actual array in the php object before.

Maybe the trick here is to not expand the json like it's doing now, but instead simply prettifying the JSON in a way that doesn't affect how it's parsed during the build.

from gitify.

Mark-H avatar Mark-H commented on September 18, 2024

This should be fixed with 961f466 as well. You'll need to do a new extract for it to rewrite the files. If it's still broken after that commit, please reopen the issue and I'll do more digging.

from gitify.

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.