add record is not working

Status
Not open for further replies.
Sorry, I had some family stuff to take care of.

As per the thread you referenced, there seems to be another lurking problem we need to track down.

Hang tight, I'll get it sorted out tomorrow.

-- hugh
 
Ok Hugh,

though i think that my error has alot common with thepost about bug [175 rev] you have posted... because my problem is just this... I create a group, an element, a form and when i SAVE....there is already a table created without selecting create table view...This is what i am describing in my previous posts...then if i click create table view...the second table view is created and there is a mess with the elements...i do not know but i read your posts and i think these problems has a common background...
 
thiliop said:
Ok Hugh,

though i think that my error has alot common with thepost about bug [175 rev] you have posted... because my problem is just this... I create a group, an element, a form and when i SAVE....there is already a table created without selecting create table view...This is what i am describing in my previous posts...then if i click create table view...the second table view is created and there is a mess with the elements...i do not know but i read your posts and i think these problems has a common background...

Yes, that BUG thread is the one I started so I could make Rob aware of these problems.

As I mentioned before, the behavior for table creation changed in 1.04. Fabrik will now automatically create the table when you save a form with the "Record in database" option selected. There is no need to "Create Table View" as a separate step, unless you did not select "Record in database".

I fixed one bug, which was causing the "Create Table View" link to be displayed even though the table has already been created. But late last night I noticed that the test table it created had three copies of the fabrik_internal_id and time_date columns, so I need to work on that problem today.

So just hang tight for a while, and hopefully we'll have this resolved today.

-- hugh
 
thiliop said:
ok....i can make some tests by myself also and feed you with my observation, in order to help you...

OK, in which case the first thing you need to do is make the change I described in this post:

http://fabrikar.com/index.php?option=com_smf&Itemid=9&topic=1180.msg4951#msg4951

... which is essentially to change:

$oForm->table_id = $oTable->id;

... to ...

$this->table_id = $oTable->id;

See the post for file, line number, etc. That fix should prevent Fabrik from giving you that "Create Table View" link when it has already automatically created the table.

What I'd be interested in seeing is if, after you make that change, when you create a new form, does the automatically created table have extra 'id' columns?


-- hugh
 
OK, I think this one is now fixed. Rob has given me access to make changes in SVN, so I just updated SVN with the fixes. So update your SVN, and give it another go.

To be on the safe side, make sure you have gotten rid of any elements, forms, groups and tables you have been testing this stuff with, as they may have internal inconsistencies which could cause problems.

If you did make any edits to your PHP files, remember that SVN will probably complain about conflicts when you update, and you'll have to 'revert' your copy of any files you have changed to the latest SVN version.

-- hugh
 
Thanks Hugh,

i did not have the time to do any testing last day... i will download latest SVN files, test it and i hope everything works ok!

Thanks for dealing with me, i think u did good job and i hope i was a little helpful for discovering this particular bug.
 
ok... i downloaded SVN rev 186 and i made some tests...i followed the usual procedure,

create a tsts group, a test element, a test form. I saved the form and the table view was auto created. Everything seemed allright, the table in the table view was ok(jos_fabrik_formdata_1) with primary key id field autoincrement. when i checked add listing and tried to enter data, the data was not inserting again in the table! Because the code creates

1) fabrik_internal_id int(11) autoincrement (OK)

but

2) time_date varchar(255) text field (NOT OK). It should be of DATE type.

I checked that from phpMyAdmin in my SQL table.

I also noticed that the elements for table view test was

fabrik_internal_id id test text field
testfield1 testfield1 test text field
time_date time_date test text field

BUT time_date should by of ELEMENT TYPE -> date NOT text field...
 
What error are you actually getting?

Things are working fine for me, I can happily insert data as soon as the form/table are created.

And as far as I can tell Fabrik doesn't use the 'date' type for the time_date field. It very specifically sets it to a simple VARCHAR field (Fabrik internal elementtype_id 2):

Code:
		$oElement = new fabrikElement( $database );
		$oElement->element_name		= "time_date";
		$oElement->element_label	= "time_date";
		$oElement->elementtype_id 	= '2';
		$oElement->hidden 			= 1;
		$oElement->eval				= 1;
		$oElement->default			= "return date('Y-m-d');";

... that uses a PHP eval'ed default to return the date string. The above code is from the createFormTable() function, untouched by me.

So I'm not quite sure what the problem is on your end.

-- hugh
 
ok! to day i am a little of busy but...i will make a test and i ll tell you about it in detail...

the wrong i get when i try to add data is:

Warning: Invalid argument supplied for foreach() in C:\AppServ\www\Joomla\components\com_fabrik\fabrik_table.class.php on line 2629

Warning: in_array() [function.in-array]: Wrong datatype for second argument in C:\AppServ\www\Joomla\components\com_fabrik\fabrik_table.class.php on line 2657

Warning: in_array() [function.in-array]: Wrong datatype for second argument in C:\AppServ\www\Joomla\components\com_fabrik\fabrik_table.class.php on line 2657

Warning: in_array() [function.in-array]: Wrong datatype for second argument in C:\AppServ\www\Joomla\components\com_fabrik\fabrik_table.class.php on line 2657
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \' ADD COLUMN `fabrik_internal_id` varchar (255) null AFTER ``, ADD COLUMN `testfi\' at line 1 SQL=ALTER TABLE , ADD COLUMN `fabrik_internal_id` varchar (255) null AFTER ``, ADD COLUMN `testfield1` varchar (255) null AFTER ``, ADD COLUMN `time_date` varchar (255) null AFTER ``
 
Is this on the front end or the backend?

In all my testing, I've just been using the front end form to add the data. I very rarely use the backend stuff for adding records. I'll check it out.

-- hugh
 
Well, this is strange. The error:

Warning: Invalid argument supplied for foreach() in C:\AppServ\www\Joomla\components\com_fabrik\fabrik_table.class.php on line 2629

... is telling us that Fabrik was unable to get a table description, probably because it isn't seeing a table name. I've tried, but I can't even come close to replicating this problem. I can see exactly what is happening, but not why.

Can you do me two favors:

First, double check your SVN directory, by using the SVN 'Check for modifications' option (on the main Tortoise SVN menu, right clicking on the top level folder of your 1.04 trunk). Make sure you don't have any files which haven't merged or downloaded properly. You should get "file list is empty" if you are fully up to date.

Second, edit your ./components/com_fabrik/fabrik.class.php, find this code, around line 1025:
Code:
				if ( !$oTable->databaseTableExists( ) ) {
					$oTable->createFormTable( $this );
				} else {
                    var_dump($oTable,$this); exit; // ADD THIS LINE
					$oTable->ammendTable( $this ); 
				}

... and add that line as commented above. Then try submitting the form again. It should print a couple of pages of debug output. Copy and paste that output into a reply to this thread.

-- hugh
 
I did what you ve said, the output is very big.So i attached...i hope this is waht you were askign for
 

Attachments

  • debugout.txt
    80.6 KB · Views: 218
when i try to insert data from the front end here is the error message i get:

Out of range value adjusted for column \'fabrik_internal_id\' at row 1 SQL=INSERT INTO jos_fabrik_formdata_1 ( `fabrik_internal_id`,`testfield1`,`time_date` ) VALUES ( \'\',\'tyiyu\',\'2007-09-06\' )
 
Ok...

i found which was the problem...just to switch strict mode of mySQL OFF... eevryhting seem to work fine now...But you should mention it to the tutorial, or installation guide of fabrik, because by default is ON... FOund it in one of your posts...

Thnx for helping Hugh
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Staff online

Members online

Back
Top