Bug: Save row (Section) produces a Database Error (Duplicate entry '0' for key 'PRIMARY) - Forum | JoomShaper
Solved SP Page Builder

Bug: Save row (Section) produces a Database Error (Duplicate entry '0' for key 'PRIMARY)

Asked by Carlos Crison 5 years ago Last activity 5 years ago

Hi, I just want to report that after update 3.7.9 of the component it produces an error when I try to save rows (sections) to reuse them on other pages.

How to reproduce it?

  1. Click on Save Section and give a name (If it's your first section saved it works)
  2. Go and repeat the process with another row (section)
  3. Try to Add the Saved Sections on to another row or page
  4. You will only see the first one you saved, no more.

Additionally I have Admin Tools installed so I get to my email the "Unhandled exception - JDatabaseExceptionExecuting"

Exception Type: JDatabaseExceptionExecuting
... public_html/libraries/joomla/database/driver/mysqli.php
Line: 665
Message: Duplicate entry '0' for key 'PRIMARY'

And also I leave you here the issue trace Admin Tools gives me:

#0 .../public_html/libraries/joomla/database/driver.php(1421): JDatabaseDriverMysqli->execute()
#1 .../public_html/administrator/components/com_sppagebuilder/models/page.php(192): JDatabaseDriver->insertObject('#__sppagebuilde...', Object(stdClass))
#2 .../public_html/administrator/components/com_sppagebuilder/controllers/page.php(267): SppagebuilderModelPage->saveSection('234', '{"id":161338414...')
#3 .../public_html/libraries/src/MVC/Controller/BaseController.php(710): SppagebuilderControllerPage->saveSection()
#4 .../public_html/administrator/components/com_sppagebuilder/sppagebuilder.php(21): Joomla\CMS\MVC\Controller\BaseController->execute('savesection')
#5 .../public_html/libraries/src/Component/ComponentHelper.php(402): require_once
#6 .../public_html/libraries/src/Component/ComponentHelper.php(377): Joomla\CMS\Component\ComponentHelper::executeComponent
#7 .../public_html/libraries/src/Application/AdministratorApplication.php(101): Joomla\CMS\Component\ComponentHelper::renderComponent('com_sppagebuild...')
#8 .../public_html/libraries/src/Application/AdministratorApplication.php(159): Joomla\CMS\Application\AdministratorApplication->dispatch()
#9 .../public_html/libraries/src/Application/CMSApplication.php(196): Joomla\CMS\Application\AdministratorApplication->doExecute()
#10 .../public_html/administrator/index.php(51): Joomla\CMS\Application\CMSApplication->execute()
#11 {main}

I hope you can fix this because I use this feature too often.

Thanks

Accepted answer

Marked as the solution
Toufiq Senior Staff

Database table id wasn't auto-increment. Now it has been updated. Thanks

6 more replies

Toufiq Senior Staff

Hi there,

Thanks for contacting us. Sorry for the inconvenience. Will you please provide me the Joomla administrator access & database access via the hidden content area and I will check & get back to you soon.

-Thanks

Carlos Crison Asked this

Hi, Im sorry for the delayed answer.

I was making some other tests, for example:

  • I installed a fresh joomla installation and sp page builder pro, and the feature works fine, it saves sections normally.
  • I checked that all my sites have the same problem, not only this, so it might be a problem with updating process
  • I disabled Admin Tools and other protection features from external CDNs and the problem persists

I sent the login info through Hidden Area. Let me know if you need something else.

Thanks.

Toufiq Senior Staff

Hi there, Thanks for getting back. Please check & let me know. Thanks

Carlos Crison Asked this

It wokrs perfectly now :). Thank you.

What was the problem? So I can reproduce the solution on my other sites.

Carlos Crison Asked this

Great !

Thanks a lot for your help.

Just to clarify, if someone else have this problem, the solution was activating the auto-increment option of the field ID of the table sppagebuildersections of the site database.

Have a great day.

Toufiq Senior Staff

You are most welcome & Thanks

Log in to reply.