71
goffy
Re: TDMCreate 1.91 alpha 1 for Testing
  • 2015/6/4 10:05

  • goffy

  • Just can't stay away

  • Posts: 543

  • Since: 2010/12/27


hi timgno

tdmcreate 1.91 alpa 3
clone from https://github.com/txmodxoops/TDMCreate-1.91.git 03.06.2015, 21:27
Xoops 2.5.7.1
firefox 37.0.2

a) module installing
a.1) uninstalled previous version
a.2) cleaned up cache
a.3) installed 1.91 alpha 3 - ok

b) Testing module TDMCreate
b.1) created new module (named: mytestmodule) - ok
b.2) create new table (named: tables1) for this new module - ok
b.3) in parameter list there is 'TextDateSelect'. Please make additionally a 'TextDateTimeSelect'
b.4) changed later number of fields/add new field to this table - ok
b.5) create second table (named: tables2) for this new module - ok
no error, but: in parameter list 'tables1' appears two times
Searching for reason I found:
in admin/fields.php there is at switch 'save' after line 170 (if ($fieldsObj->isNew()) {)
// Fields Elements Handler
            
$fieldelementObj =& $tdmcreate->getHandler('fieldelements')->create();
            
$fieldelementObj->setVar'fieldelement_mid'$fieldMid );
            
$fieldelementObj->setVar'fieldelement_tid'$fieldTid );
            
$fieldelementObj->setVar'fieldelement_name''Table : '.ucfirst($tableName) );
            
$fieldelementObj->setVar'fieldelement_value''XoopsFormTables-'.ucfirst($tableName) );
            
// Insert new field element id for table name
            
if (!$tdmcreate->getHandler('fieldelements')->insert($fieldelementObj) ) {
                
$GLOBALS['xoopsTpl']->assign('error'$fieldelementObj->getHtmlErrors() . ' Field element');
            }

and each time you add a new field you get a new item in table 'tdmcreate_fieldelements' for the same table (indicated by my test item 7)
please delete this and add in admin/tables.php after line 187 ($tableAction = '&field_mid=' . $tableMid . '&field_tid=' . $tableTid . '&field_numb=' . $tableNumbFields . '&field_name=' . $tableFieldname;)
// Fields Elements Handler
                
$fieldelementObj =& $tdmcreate->getHandler('fieldelements')->create();
                
$fieldelementObj->setVar'fieldelement_mid'$tableMid );
                
$fieldelementObj->setVar'fieldelement_tid'$tableTid );
                
$fieldelementObj->setVar'fieldelement_name''Table : '.ucfirst($_POST['table_name']) );
                
$fieldelementObj->setVar'fieldelement_value''XoopsFormTables-'.ucfirst($_POST['table_name']) );
                
// Insert new field element id for table name
                
if (!$tdmcreate->getHandler('fieldelements')->insert($fieldelementObj) ) {
                    
$GLOBALS['xoopsTpl']->assign('error'$fieldelementObj->getHtmlErrors() . ' Field element');
                }

, then you get only a new item in table 'tdmcreate_fieldelements', if you create a new table

b.6) if you delete a table, the item in table 'fieldelements' is not deleted and it will be still shown in parameter list for the fields (and this can only make troubles)
please add in admin/tables at switch 'delete' after 'if ($tdmcreate->getHandler('tables')->delete($tablesObj)) {'
//delete items in table fieldelements
                
$crit_fieldelements = new CriteriaCompo();
                
$crit_fieldelements->add(new Criteria('fieldelement_tid'$tableId));
                
$fieldelements $tdmcreate->getHandler('fieldelements')->getAll($crit_fieldelements);
                foreach (
array_keys($fieldelements) as $fe) {
                    
$fieldelementsObj =& $tdmcreate->getHandler('fieldelements')->get($fieldelements[$fe]->getVar('fieldelement_id'));
                    if (!
$tdmcreate->getHandler('fieldelements')->delete($fieldelementsObj)) {
                        echo 
$fieldelementObj->getHtmlErrors();
                    }
                    unset (
$fieldelementsObj);
                }


b.7) after clicking on building module, all is marked es well done

c) testing new module
c.1) installing module - ok
c.2) after installation I went directly to module settings, after click on safe I got error:
Parse error: syntax error, unexpected 'public' (T_PUBLIC) in C:\Homepages\Xampp\htdocs\xoops2571\htdocs\modules\mytestmodule\class\tables1.php on line 173
Searching for error I found:
- in my 'tables1' I have as last field a radio yes/no, named 't1_add_yesno'
- in class/tables1.php after the class MytestmoduleTables1 there is additionally
/**
     * Get Options
     */
    
public function getOptions()
    {
        
$ret = array();
        if (
== $this->getVar('t1_add_yesno')) {
            
array_push($ret'add_yesno');
        }
        return 
$ret;
    }
}

and this causes the error
if I delete this, it works

c.3) adding new item to tables1 - ok
c.4) adding new item to tables2 works, but:
I have in my 'tables2' one field with type 'DhtmlTextArea'. In the form generated by class/tables2.php I get the always the editor defined by 'Preferences/Editor'
That's basically ok, but we have 3 possibilities:
- then we should name the field type e.g. 'Editor defined in module prefs'
- this field should be always 'DhtmlTextArea'
- make field type 'DhtmlTextArea' (which should be then always DhtmlTextArea) plus 'Editor defined in module prefs'

d) Testing user side of new module:
d.1) on the index pages there are following errors in debug area:
Notice: Undefined variable: sysPathIcon32 in file /modules/mytestmodule/footer.php line 26
Notice: Undefined variable: dirname in file /modules/mytestmodule/footer.php line 28
Notice: Undefined variable: dirname in file /modules/mytestmodule/footer.php line 30
Notice: Undefined variable: dirname in file /modules/mytestmodule/footer.php line 31

d.2) on the index pages there is e.g _MA_MYTESTMODULE_TABLES1, but in the language file is _MA_MYTESTMODULE_TABLE1 defined
now we can change _MA_MYTESTMODULE_TABLES1 or _MA_MYTESTMODULE_TABLE1
IMO we should change to _MA_MYTESTMODULE_TABLES1, otherwise we have later the same problem with _MA_MYTESTMODULE_TABLES1_DESC

in class/files/language/LanguageMain.php line 98 ff should be
$tableName    $tables[$i]->getVar('table_name');
            
$stuTableName strtoupper($tableName);
            
$ucfTableName UcFirstAndToLower($tableName);
            
$tableSoleName    $tables[$i]->getVar('table_solename');
            
$stuTableSoleName strtoupper($tableSoleName);
            
$ucfTableSoleName UcFirstAndToLower($tableSoleName);
            
$ret .= $this->defines->getAboveDefines($ucfTableName);
            
$ret .= $this->defines->getDefine($language$stuTableName$ucfTableName);
            
$ret .= $this->defines->getDefine($language"{$stuTableName}_DESC""{$ucfTableName} description");
            
$ret .= $this->defines->getAboveDefines("Caption of {$ucfTableName}");
instead of
$tableSoleName    $tables[$i]->getVar('table_solename');
            
$stuTableSoleName strtoupper($tableSoleName);
            
$ucfTableSoleName UcFirstAndToLower($tableSoleName);
            
$ret .= $this->defines->getAboveDefines($ucfTableSoleName);
            
$ret .= $this->defines->getDefine($language$stuTableSoleName$ucfTableSoleName);
            
$ret .= $this->defines->getDefine($language"{$stuTableSoleName}_DESC""{$ucfTableSoleName} description");
            
$ret .= $this->defines->getAboveDefines("Caption of {$ucfTableSoleName}");


d.3) if I want to show my 'tables1' I get errors:
Parse error: syntax error, unexpected ')' in C:\Homepages\Xampp\htdocs\xoops2571\htdocs\modules\mytestmodule\tables1.php on line 54
please check class/files/user/UserPages.php line 137
IMO the line
$xoBreadcrumbs[] = {$language}{$stuTableSoleName});
can be deleted


d.4) fixed bug d.3), if I want to show once more my 'tables1' I get error:
Notice: Use of undefined constant _MA_MYTESTMODULE_TABLE1 - assumed '_MA_MYTESTMODULE_TABLE1' in file /modules/mytestmodule/tables1.php line 53
Notice: Undefined variable: sysPathIcon32 in file /modules/mytestmodule/footer.php line 26
Notice: Undefined variable: dirname in file /modules/mytestmodule/footer.php line 28
Notice: Undefined variable: dirname in file /modules/mytestmodule/footer.php line 30
Notice: Undefined variable: dirname in file /modules/mytestmodule/footer.php line 31

d.5) in class/files/user/UserPages.php line 136
$xoBreadcrumbs[] = array('link' => {$stuModuleDirname}_URL '/{$tableName}.php''title' => {$language}{$stuTableSoleName});

should be replace by
$xoBreadcrumbs[] = array('link' => {$stuModuleDirname}_URL '/{$tableName}.php''title' => {$language}{$stuTableName});


d.6) the content of my tables1 is not shown, reason:
in tables1.php you create an array named 'tables1_list' which is appended to templates/mytestmodule/tables1.tpl, but there I find '<{foreach item=list from=$tables1}>'

therefore in class/files/templates/user/TemplatesUserPages.php line 129
<{foreach item=list from=${$tableName}}>;
should be replace by
<{foreach item=list from=${$tableName}_list}>


d.7) fixed d.5, but in the list header you find always '_MA_MYTESTMODULE_T1_ID', '_MA_MYTESTMODULE_T1_NAME' and so one
reason:
in tables1.tpl you have _MA_MYTESTMODULE_T1_ID, in language file main.php you have _MA_MYTESTMODULE_TABLE1_ID



Stop testing for the moment
done in my fork on github:
b.5)
b.6)
d.2)
d.3)
d.5)
d.6)

todos:
b.3)
c.2) - i do not know what is the reason for this code :-|
c.4)
d.1)
d.7)

72
heyula
Re: TDMCreate 1.91 alpha 1 for Testing
  • 2015/6/4 11:22

  • heyula

  • Theme Designer

  • Posts: 596

  • Since: 2008/4/24


@timingo

Are you a new video for module !

73
xoobaru
Re: TDMCreate 1.91 alpha 1 for Testing
  • 2015/6/4 15:42

  • xoobaru

  • Just can't stay away

  • Posts: 494

  • Since: 2010/12/2


What is the purpose of TDMCreate? Is this to be a starting base for building new modules?

74
Bleekk
Re: TDMCreate 1.91 alpha 1 for Testing
  • 2015/6/4 17:16

  • Bleekk

  • Theme Designer

  • Posts: 941

  • Since: 2002/12/14


exactly!
but I think it is a little bit more then only a starting base

75
goffy
Re: TDMCreate 1.91 alpha 1 for Testing
  • 2015/6/4 17:50

  • goffy

  • Just can't stay away

  • Posts: 543

  • Since: 2010/12/27


yes, http://wettklettern.eu and http://mtbrace.eu have been created with this tool

76
timgno
Re: TDMCreate 1.91 alpha 1 for Testing
  • 2015/6/13 15:41

  • timgno

  • Module Developer

  • Posts: 1504

  • Since: 2007/6/21


Pleace @goffy Pull a request on GitHub for your fixes

77
goffy
Re: TDMCreate 1.91 alpha 1 for Testing
  • 2015/6/16 11:00

  • goffy

  • Just can't stay away

  • Posts: 543

  • Since: 2010/12/27


hi timgno

it seems, that you have already fixed most of the bugs of post #71.

I updated my fork and found a bug concerning creation of breadcrumb. For this I made a pull request.

On user side output is not working, but I have not enough time for testing at the Moment, maybe next week.

what do you think about my suggestions b.3 and c.4 in post #71

78
timgno
Re: TDMCreate 1.91 alpha 1 for Testing
  • 2015/6/21 5:54

  • timgno

  • Module Developer

  • Posts: 1504

  • Since: 2007/6/21


Quote:
what do you think about my suggestions b.3 and c.4 in post #71


Suggestion b.3 certainly, but not in this version, this should change all the code elements fields and would work a little longer, maybe in the next version.

Suggestion c.4, you can do if you can put in your personal copy by default the type of editor, we take the code from the core to determine the type of editor, why bother?

79
timgno
Re: TDMCreate 1.91 alpha 1 for Testing
  • 2015/6/28 20:46

  • timgno

  • Module Developer

  • Posts: 1504

  • Since: 2007/6/21


Release alpha 3.3 is available

Test code passed by scrutinizer with quality 7,47

Refactoring code.

Needed more tests

80
Mamba
Re: TDMCreate 1.91 alpha 1 for Testing
  • 2015/6/28 21:24

  • Mamba

  • Moderator

  • Posts: 11409

  • Since: 2004/4/23


Quote:
Release alpha 3.3 is available
Test code passed by scrutinizer with quality 7,47

Timgno, you really need to add to your "test checklist":
- test a fresh install before release

This is what I am getting:

Unable to install tdmcreateError(s):
Installing TDMCreate

Column count doesn
't match value count at row 1

I appreciate very much your hard work and dedication, but this is like the n-th time happening that you release a new version and we cannot even install it, and we've talked about it several times already

Create a Codeception test for fresh install and uninstall of the module, and run these tests before a new release (plus all the other tests), and this issue will never show up again!

Let us know once this is fixed...
Support XOOPS => DONATE
Use 2.5.11 | Docs | Modules | Bugs

Login

Who's Online

337 user(s) are online (203 user(s) are browsing Support Forums)


Members: 0


Guests: 337


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits