Subject:*
<
Name/Email:*
<
Message Icon:*
<
Select*
<
Message:*
<



Click the Preview to see the content in action.
Options:*
<
Confirmation Code*
<
8 - 1 = ?  
Input the result from the expression
Maximum attempts you can try: 10
*
<
   

Re: Control structures elseif.php
by timgno on 2014/6/19 10:29:04

Now I can update the data by replacing
field_tid:
le="color: #000000"><?php class TDMCreateFieldsHandler extends XoopsPersistableObjectHandler { /* * @public function constructor class * @param mixed $db */ public function __construct(&$db) { parent::__construct($db, 'mod_tdmcreate_fields', 'tdmcreatefields', 'field_tid', 'field_name'); }

with

field_id:
le="color: #000000"><?php class TDMCreateFieldsHandler extends XoopsPersistableObjectHandler { /* * @public function constructor class * @param mixed $db */ public function __construct(&$db) { parent::__construct($db, 'mod_tdmcreate_fields', 'tdmcreatefields', 'field_id', 'field_name'); }


for keyName but I can not edit selected according to the table because I want to edit any table, the first table shows the form, always
Re: Control structures elseif.php
by timgno on 2014/6/19 8:58:16

Quote:

Mamba wrote:...
We can NOT blame everything on the XOOPS Core!!
...
And let's be realistic: in 95-98% of cases it is our mistake, not a bug in the Core
...


Mine is not a fault to the core, but a request for help, since I did some testing with the tools at my disposal as sahi and selenium ide.

From these tests have not found a good help.

For this reason, I ask again for help to see if there are other more effective tools that can solve this little problem.

Do not be altered ...! I know the work that is behind the core, and it is not my intention to throw the assessments so haphazardly
Re: Control structures elseif.php
by Mamba on 2014/6/18 19:22:54

Quote:
At this point I do not know if I should create a special function with native php functions or if there is no other solution.

I don't have the answer for it without looking at your code, but one thing is for sure:

We can NOT blame everything on the XOOPS Core!!

As I've mentioned before, debugging is a systematic process, where you have set your assumptions, and then test them step by step. If an object is not present as it should, you have to go step by step, set up breaks in the code, and then check if the object is being instantiated where it should be.

And let's be realistic: in 95-98% of cases it is our mistake, not a bug in the Core

This, of course, is not to say that there are no bugs in the Core! It might happen for example, that a code that worked on PHP 4, is becoming a bug under PHP 5.5.x.

But we need to do our homework first, i.e. test the module code we're writing, and once we're absolutely sure that our logic is correct, as proved by tests, then look at the Core and then test it at the Core level before we jump to any conclusions and blame it on the Core!
Re: Control structures elseif.php
by timgno on 2014/6/18 18:46:29

Quote:

geekwright wrote:
Looking in SVN to get the context I am suspicious of line 171 in \modules\TDMCreate\admin\fields.php:

le="color: #000000"><?php switch($value){ case 'new': $fieldsObj =& $fields->create(); break; case 'edit': $fieldsObj =& $fields->get($value); break; }


The 'edit' case is always $fieldsObj =& $fields->get('edit');

Hope that helps.


Thank you Richard!

I had already figured this out, unfortunately I have to keep it that way for now if I want to create again.

I tried to insert that works send this update, but overwrites all fields in the same table with the last:

le="color: #000000"><?php switch($value){ case 'new': $fieldsObj =& $fields->create(); break; case 'edit': $fieldsObj =& $fields->get($field_tid); break; }


Example:
field_id
field_name
field_desc

It write them all three fields with field_desc data

I know that I need to retrieve all of the fields based on the id table, and this is done but it is not saved regularly.

I tried to put in place of 'edit' in the class file -> getVar ('field_id') but I have not solved.

At this point I do not know if I should create a special function with native php functions or if there is no other solution.

Any suggestions?

Thanks again

Louis
Re: Control structures elseif.php
by geekwright on 2014/6/18 16:16:17

Looking in SVN to get the context I am suspicious of line 171 in \modules\TDMCreate\admin\fields.php:

le="color: #000000"><?php switch($value){ case 'new': $fieldsObj =& $fields->create(); break; case 'edit': $fieldsObj =& $fields->get($value); break; }


The 'edit' case is always $fieldsObj =& $fields->get('edit');

Hope that helps.

Who's Online

184 user(s) are online (151 user(s) are browsing Support Forums)


Members: 0


Guests: 184


more...

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits