Bug: Save Row (Section) Produces A Database Error (Duplicate Entry '0' For Key 'PRIMARY) - Question | JoomShaper
SP Page Builder 6 is Here! Learn More →

Bug: Save Row (Section) Produces A Database Error (Duplicate Entry '0' For Key 'PRIMARY)

Carlos Crison

Carlos Crison

SP Page Builder 4 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

0
7 Answers
Toufiq
Toufiq
Accepted Answer
Senior Staff 4 years ago #7495

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

0
Toufiq
Toufiq
Accepted Answer
Senior Staff 4 years ago #6921

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

0
Carlos Crison
Carlos Crison
Accepted Answer
4 years ago #7463

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.

0
Toufiq
Toufiq
Accepted Answer
Senior Staff 4 years ago #7476

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

0
Carlos Crison
Carlos Crison
Accepted Answer
4 years ago #7488

It wokrs perfectly now :). Thank you.

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

0
Carlos Crison
Carlos Crison
Accepted Answer
4 years ago #7612

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.

0
Toufiq
Toufiq
Accepted Answer
Senior Staff 4 years ago #7713

You are most welcome & Thanks

0