Comments (3)
The issue still exist, if you leave empty the field name prefix:
from tdmcreate.
This is what is going on:
- 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';
- 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.
Merged!
from tdmcreate.
Related Issues (20)
- include/common.php HOT 3
- Wrong link to forum support HOT 1
- missing define to be added HOT 3
- templates system_bookmarks.tpl and system_fbcomments.tpl HOT 7
- bug in admin/settings.php HOT 1
- print.php HOT 1
- getConfig() error HOT 5
- Typos in function names
- Use XoopsRequest
- Duplicate License entry in xoops_version.php
- Reference mismatch, copy will be dispatched into function
- Missing "switch"
- Single quotes
- Wrong links to spinner.gif
- Bugs HOT 1
- Module tab patient not editable HOT 8
- editorHandler in xoops_version.php HOT 2
- Permissions are not saved HOT 5
- delete code in admin pages HOT 8
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 tdmcreate.