[SOLVED] List created with id 0

marcq

Member
Fabrik version 3.5
Joomla version 3.6

Hi,

Today I wanted to create a list, list was created but with id = 0. First time I'm experiencing this. I start also to have problem by creating records with fabrik forms and often a message is displayed saying for example :

Duplicate entry '0' for key 'PRIMARY' SQL=INSERT INTO fab_booking_taken (parent_id,book_date,book_start,book_end) VALUES ('11','2017-06-30 07:30','06:00:00','12:00:00')

I have uploaded backups and older database but still the same issues.

Any idea hoz I could fix this ?

Thanks in advance for you support.

marc
 
Sounds like some of the primary keys in your database tables have gotten "auto increment" turned off.

You need to manually look at (at least) your #__fabrik_lists and whatever the table that booking row was on, see if their 'id' primary key columns are still set to auto-inc.

If you want me to take a look, you'll need to give me CPanel / phpMyAdmin access.

-- hugh
 
Thank you Hugh, please see My Sites LA NEPTUNE, you have all needed access (joomla and PhpMy admin). Would be good if you could have a look since nothing seems to work. Im experiencing massive issues with auto inc and keys in general. Cheers, marc
 
Thank you Hugh, please see My Sites LA NEPTUNE, you have all needed access (joomla and PhpMy admin). Would be good if you could have a look since nothing seems to work. Im experiencing massive issues with auto inc and keys in general. Cheers, marc
 
I had a quick look:

Yes, #__fabrik_lists doesn't have a PK or any index (form_id), same with fabrik_element, fabrik_form (I didn't check others)

fab_booking_taken has PK set but AUTOINCREMENT missing.

Same (indices are there but AUTOINCREMENT missing) with e.g. #__content

You can fix this manually.
BUT how could this have happend?
 
Hi troester, thanks for having a look, I have no idea how it could happen... Basically I just need to had a auto increment to all my tables right ? Do I need other index by the way ?
 
Best is to compare with one of your other databases.
You must set primary keys (if missing), autoincrement and indices (indices are e.g. on columns which are filter elements, dbjoins,...)

Backup!! your DB before doing any modification.

For every table display the "Stucture", open additionally "Indices" at the bottom of the structure listing, compare with the appropriate table of an other Joomla installation, fix.

And find the reason why these informations vanished.
 
I would suggest restoring from your most recent known good backup, rather than trying to repair the damage.

I can pretty much guarrantee that this damage isn't from Fabrik. There is nothing in our code that would alter the PK's of our metadata tables (#__fabrik_lists, etc) or in any other way alter the structure, other than to add some indexes during an update.

-- hugh
 
Hi Hugh, of course it isn't an Fabrik issue.

I was just wondering why all auto-increment where systematically deleted, some primary keys too, but indexes not.

Now I have restored a 2 weeks older Akeeba backup into another subdomain. I have compared each table (primary key, index, auto-inc) in both database and corrected the concerned database and it seems to work now.

Thanks for your support troester and Hugh.

Cheers, marc
 
Glad you had a backup, although a shame you had to go back 2 weeks.

I'd love to know what caused this.

-- hugh
 
Thanks Hugh, I didn't have to go back, since I keep the damaged database and go through all 150 tables compared and checked on primary key, indexes and auto-increments. It was a long process, but by proceeding like this I didn't loose anything ;-)
I would love to know too what was behind this, since even if I'm tired since a few weeks I couldn't have deleted all auto-inc and some primary key without realising that I'm doing something waird. But anyway problem is solved, take care, marc
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top