Giter Site home page Giter Site logo

Comments (7)

monishdeb avatar monishdeb commented on August 15, 2024

Thanks @tanyabouman for raising this issue, which has compelled me to compare the 4.7 branch with master and 5.0 branch, so to bring in the 4.7 compatible fixes in current branch that were missed out. And after cherry-picking those commits, I have merged then first to 5.0 and then in master and here's the PR - #137

Can you please test the master branch if there are any outstanding issue before I publish a new release 1.6.1?

from biz.jmaconsulting.grantapplications.

tanyabouman avatar tanyabouman commented on August 15, 2024

I updated to the latest code from the master branch, and I am getting an error when I submit the form.
DB Error: constraint violation

Previously, I was getting a 500 error upon submission of the form, but it still successfully recorded the submission. Now the submission isn't going through at all. I don't really know if the update is causing a new problem, since there was an existing problem there. I'm running Backdrop CMS 4.9.7, with CiviCRM 5.2.2.

from biz.jmaconsulting.grantapplications.

monishdeb avatar monishdeb commented on August 15, 2024

@tanyabouman after updating the code, can you try again after re-login (which clear the cache and drops the old DB state) to your Backdrop site? I checked on BackDrop CMS 4.9.7 + Civi 5.2.2 and I wasn't able to replicate the DB error. If you are still getting the DB error, can you please share the backtrace here from CiviCRM configlog? To know the source of this issue.

from biz.jmaconsulting.grantapplications.

tanyabouman avatar tanyabouman commented on August 15, 2024

I'm still getting the error. This is from the ConfigAndLog file.

Jul 06 09:08:08  [info] $Fatal Error Details = Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -3
    [message] => DB Error: constraint violation
    [mode] => 16
    [debug_info] => INSERT INTO civicrm_grant (currency , status_id ) VALUES ('CAD' ,  1 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`[site]_civicrm`.`civicrm_grant`, CONSTRAINT `FK_civicrm_grant_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]
    [type] => DB_Error
    [user_info] => INSERT INTO civicrm_grant (currency , status_id ) VALUES ('CAD' ,  1 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`[site]_civicrm`.`civicrm_grant`, CONSTRAINT `FK_civicrm_grant_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]
    [to_string] => [db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_grant (currency , status_id ) VALUES ('CAD' ,  1 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`[site]_civicrm`.`civicrm_grant`, CONSTRAINT `FK_civicrm_grant_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]"]
)


Jul 06 09:08:08  [info] $backTrace = #0 [site]/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(232): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 [site]/public_html/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(921): CRM_Core_Error::handle(Object(DB_Error))
#2 [site]/public_html/wp-content/plugins/civicrm/civicrm/packages/DB.php(985): PEAR_Error->__construct("DB Error: constraint violation", -3, 16, (Array:2), "INSERT INTO civicrm_grant (currency , status_id ) VALUES ('CAD' ,  1 )  [nati...")
#3 [site]/public_html/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(575): DB_Error->__construct(-3, 16, (Array:2), "INSERT INTO civicrm_grant (currency , status_id ) VALUES ('CAD' ,  1 )  [nati...")
#4 [site]/public_html/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(223): PEAR->_raiseError(Object(DB_mysqli), NULL, -3, 16, (Array:2), "INSERT INTO civicrm_grant (currency , status_id ) VALUES ('CAD' ,  1 )  [nati...", "DB_Error", TRUE)
#5 [site]/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1905): PEAR->__call("raiseError", (Array:7))
#6 [site]/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(933): DB_common->raiseError(-3, NULL, NULL, "INSERT INTO civicrm_grant (currency , status_id ) VALUES ('CAD' ,  1 )  [nati...", "1452 ** Cannot add or update a child row: a foreign key constraint fails (`tr...")
#7 [site]/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(403): DB_mysqli->mysqliRaiseError()
#8 [site]/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1216): DB_mysqli->simpleQuery("INSERT INTO civicrm_grant (currency , status_id ) VALUES ('CAD' ,  1 ) ")
#9 [site]/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2443): DB_common->query("INSERT INTO civicrm_grant (currency , status_id ) VALUES ('CAD' ,  1 ) ")
#10 [site]/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(1068): DB_DataObject->_query("INSERT INTO civicrm_grant (currency , status_id ) VALUES ('CAD' ,  1 ) ")
#11 [site]/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(548): DB_DataObject->insert()
#12 [site]/public_html/wp-content/plugins/civicrm/civicrm/CRM/Grant/BAO/Grant.php(181): CRM_Core_DAO->save()
#13 [site]/public_html/wp-content/plugins/civicrm/civicrm/CRM/Grant/BAO/Grant.php(240): CRM_Grant_BAO_Grant::add((Array:1), (Array:0))
#14 [site]/public_html/wp-content/plugins/files/civicrm/ext/biz.jmaconsulting.grantapplications/CRM/Grant/Form/Grant/Confirm.php(608): CRM_Grant_BAO_Grant::create((Array:1), (Array:0))
#15 [site]/public_html/wp-content/plugins/files/civicrm/ext/biz.jmaconsulting.grantapplications/CRM/Grant/BAO/Grant/Utils.php(63): CRM_Grant_Form_Grant_Confirm::processApplication(Object(CRM_Grant_Form_Grant_Confirm), (Array:44), "1832", "1")
#16 [site]/public_html/wp-content/plugins/files/civicrm/ext/biz.jmaconsulting.grantapplications/CRM/Grant/Form/Grant/Confirm.php(542): CRM_Grant_BAO_Grant_Utils::processConfirm(Object(CRM_Grant_Form_Grant_Confirm), (Array:37), "1832", "1", "grant", (Array:0))
#17 [site]/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php(453): CRM_Grant_Form_Grant_Confirm->postProcess()
#18 [site]/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/StateMachine.php(160): CRM_Core_Form->mainProcess()
#19 [site]/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Next.php(61): CRM_Core_StateMachine->perform(Object(CRM_Grant_Form_Grant_Confirm), "next", "Next")
#20 [site]/public_html/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Next->perform(Object(CRM_Grant_Form_Grant_Confirm), "next")
#21 [site]/public_html/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Grant_Form_Grant_Confirm), "next")
#22 [site]/public_html/wp-content/plugins/files/civicrm/ext/biz.jmaconsulting.grantapplications/CRM/Core/Controller.php(351): HTML_QuickForm_Page->handle("next")
#23 [site]/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(309): CRM_Core_Controller->run((Array:3), NULL)
#24 [site]/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:15))
#25 [site]/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:3))
#26 [site]/public_html/wp-content/plugins/civicrm/civicrm.php(1246): CRM_Core_Invoke::invoke((Array:3))
#27 [site]/public_html/wp-content/plugins/civicrm/includes/civicrm.basepage.php(141): CiviCRM_For_WordPress->invoke()
#28 [site]/public_html/wp-includes/class-wp-hook.php(286): CiviCRM_For_WordPress_Basepage->basepage_handler(Object(WP))
#29 [site]/public_html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters("", (Array:1))
#30 [site]/public_html/wp-includes/plugin.php(515): WP_Hook->do_action((Array:1))
#31 [site]/public_html/wp-includes/class-wp.php(726): do_action_ref_array("wp", (Array:1))
#32 [site]/public_html/wp-includes/functions.php(960): WP->main("")
#33 [site]/public_html/wp-blog-header.php(16): wp()
#34 [site]/public_html/index.php(17): require("[site]/public_html/wp-blog-header.php")
#35 {main}

from biz.jmaconsulting.grantapplications.

monishdeb avatar monishdeb commented on August 15, 2024

Hi @tanyabouman

Sorry for the delay. I have fixed the issue and updated the master branch. Can you please check the latest code of master branch?

Thanks!

from biz.jmaconsulting.grantapplications.

tanyabouman avatar tanyabouman commented on August 15, 2024

Yes, that solves the problem, so that the submission now works.

from biz.jmaconsulting.grantapplications.

monishdeb avatar monishdeb commented on August 15, 2024

Great. Thanks for your feedback. Closing this issue now.

from biz.jmaconsulting.grantapplications.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.