Giter Site home page Giter Site logo

Comments (3)

mambax7 avatar mambax7 commented on July 30, 2024

The issue still exist, if you leave empty the field name prefix:
image

from tdmcreate.

mambax7 avatar mambax7 commented on July 30, 2024

This is what is going on:

  1. You have this function:
    public function getXcGetValues($tableName, $tableSoleName, $index = 'i', $noArray = false, $t = '')
    {
        $index = '' !== $index ? $index: 'i';
        $ucfTableName = ucfirst($tableName);
        if (!$noArray) {
            $ret = "{$t}\${$tableSoleName} = \${$tableName}All[\${$index}]->getValues{$ucfTableName}();\n";
        } else {
            $ret = "{$t}\${$tableSoleName} = \${$tableName}->getValues{$ucfTableName}();\n";
        }

        return $ret;
    }

When you call it from inside the function getBodyCategoriesIndex, you call it as:

$foreach = $this->xc->getXcGetValues($tableName, $tableSoleName, $tableFieldname, false, "\t");

Since the $tableFieldname is empty, the $index remains empty, because the default that you set as index = 'i' will never be set, as PHP will see the '' as valid.

So you need to add a check:

$index = '' !== $index? $index: 'i';
  1. You are sending the wrong variable in the function getBodyPagesIndex.

The function expects " $tableSoleName":

function getXcGetValues($tableName, $tableSoleName, $index = 'i', $noArray = false, $t = '')

but you're sending "$tableFieldname" which is empty

$foreach = $this->xc->getXcGetValues($tableName, $tableFieldname, 'i', false, "\t");

so the generated code for a table "news" is then:

    foreach(array_keys($newsAll) as $) {
        $ = $newsAll[$i]->getValuesNews();

instead of:

    foreach(array_keys($newsAll) as $i) {
        $news = $newsAll[$i]->getValuesNews();

from tdmcreate.

txmodxoops avatar txmodxoops commented on July 30, 2024

Merged!

from tdmcreate.

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.