Support Forum

  • Page:
  • 1

K2 item ID

zentoolsIf you use Zentools please post a review at the Joomla! Extensions Directory.

Hi
I have accidentially changed ID number of K2 item (through the database table) to 10000000000000. Now all my new item gets the numbers after that. Is it possiblle to revert it? Changing the 10000000000000 and next to the previous ID (in database K2 item table) don't work. Still the 10000000000001 number is created.
Anybody can help? Where the last K2item ID is stored?
regards Tomek
  • witraze's Avatar
  • witraze
  • 12 Month basic
  • 346 posts
  • 20 Thanks
  • Karma: 8
The administrator has disabled public write access.
Hi Tomek,

As far as I understand you would just need to edit any of the database tables that you changed.

It sounds like K2 auto-increments the id so you would need to go in and change the id manually. In Joomla 2.5 and Joomla 3 there is a relationship to the assets table as well so you may need to check a number of tables to fix this.

Hope that helps.

Anthony
  • Anthony Olsen's Avatar
  • Anthony Olsen
  • LIfetime Developer - Big Bamboo
  • 23925 posts
  • 788 Thanks
  • Karma: 433
The administrator has disabled public write access.
Anthony Olsen wrote:
Hi Tomek,

As far as I understand you would just need to edit any of the database tables that you changed.
Anthony
Exactly!Anthony Olsen wrote:
It sounds like K2 auto-increments the id so you would need to go in and change the id manually. In Joomla 2.5 and Joomla 3 there is a relationship to the assets table as well so you may need to check a number of tables to fix this.
You are right. The point is that I cant identify the right tables in database :( but will try again.

Thank you very much Anthony for your precious time!
rgds Tomek
  • witraze's Avatar
  • witraze
  • 12 Month basic
  • 346 posts
  • 20 Thanks
  • Karma: 8
The administrator has disabled public write access.
The k2 item can be found in #__k2_items

Change the id number back to what it should be and then you need to reset the autoindex

Go back to the main database overview of all the tables and click on sql in the top menu and use
ALTER TABLE `itn5u_k2_items` AUTO_INCREMENT=255

Change the prefix to match your database and then change the value to be 1 higher than the id of the last article.

The assets table is a bit more difficult. You would need to search for the k2 item with your edited id value and set it back to what it should be.
Something like:
SELECT * FROM `itn5u_assets` WHERE name='com_k2' AND parent_id=10000000000000

or you could try an extension like acl manager to try and fix the assets.

Best of luck.

Rob
  • Robert Went's Avatar
  • Robert Went
  • Moderator
  • 2210 posts
  • 196 Thanks
  • Karma: 90
The administrator has disabled public write access.
Hi Rob
Wow, I managed it!
You are extremly nice and helpful. Thank you Rob and Anthony!
To be honest I had no hope that somebody will spare a time to help me - the problem was very specific ....
But JBteam rocks!!!!

regards Tomek
  • witraze's Avatar
  • witraze
  • 12 Month basic
  • 346 posts
  • 20 Thanks
  • Karma: 8
The administrator has disabled public write access.
Great!

Glad you got it back to normal.

Rob
  • Robert Went's Avatar
  • Robert Went
  • Moderator
  • 2210 posts
  • 196 Thanks
  • Karma: 90
The administrator has disabled public write access.

zentoolsIf you use Zentools please post a review at the Joomla! Extensions Directory.

Happy Campers