Subform never completes save

Subform never completes save

Postby EcoReality » Thu Feb 23, 2017 10:43 am

I have a subform that never completes a save; it just shows the "blip" animated GIF forever. I go look at the table via another tool (Sequel Pro), and it does not change.

The last thing I did was change two of the subform fields from TINYINT(3) to FLOAT. I then went to those objects in nuBuilder and changed the format to blank from "10000".

This table also has two ENUM fields, and they were behaving badly until I removed the first bar ("|") from the "Dropdown --> SQL" field in the object editor.

I have not messed with table or field names.

What are some reasons a subform might get stuck and never complete a save?
:::: Jan Steinman EcoReality Co-op ::::
EcoReality
 
Posts: 26
Joined: Wed Feb 15, 2017 5:20 pm
Location: Salt Spring Island, British Columbia, Canada

Re: Subform never completes save

Postby admin » Thu Feb 23, 2017 12:43 pm

Jan,

You may need to look at apache's php error log.

Steven
admin
Site Admin
 
Posts: 3223
Joined: Mon Jun 15, 2009 9:53 am

Re: Subform never completes save

Postby EcoReality » Thu Feb 23, 2017 4:22 pm

Good idea.

When I try to save, I get:

Code: Select all
[Wed Feb 22 22:37:11 2017] [error] [client 10.1.2.2] PHP Fatal error:  Uncaught exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`SSIAA`.`Questionare_Workforce`, CONSTRAINT `Questionare-Workforce` FOREIGN KEY (`Questionare`) REFERENCES `Questionares` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION)' in /Library/WebServer/EcoReality/a/nuBuilderPro-master/nuapi.php:788\nStack trace:\n#0 /Library/WebServer/EcoReality/a/nuBuilderPro-master/nuapi.php(788): PDO->exec('INSERT INTO `Qu...')\n#1 /Library/WebServer/EcoReality/a/nuBuilderPro-master/nuapi.php(675): nuGetNewPrimaryKey('Questionare_Wor...', 'ID')\n#2 /Library/WebServer/EcoReality/a/nuBuilderPro-master/nuapi.php(140): nuSaveForm(Array, Array)\n#3 {main}\n  thrown in /Library/WebServer/EcoReality/a/nuBuilderPro-master/nuapi.php on line 788, referer: ****************


I do have InnoDB constraints defined, and they work properly in tools like phpMyAdmin and Sequel Pro. They are handy in "bare metal tools" because they let you follow references easily.

I removed them, and things are saving properly. Odd, that.
Last edited by EcoReality on Thu Feb 23, 2017 5:36 pm, edited 1 time in total.
:::: Jan Steinman EcoReality Co-op ::::
EcoReality
 
Posts: 26
Joined: Wed Feb 15, 2017 5:20 pm
Location: Salt Spring Island, British Columbia, Canada

Re: Subform never completes save

Postby EcoReality » Thu Feb 23, 2017 5:33 pm

Are you doing something that would cause InnoDB constraint violations, like delete/add instead of UPDATE?

I can do the functionally identical INSERTs and UPDATEs with the constraints in place.

Unless I had a problem in my constraints, I consider this a bug. InnoDB is pretty strict about setting up relations. I don't think I had a problem there.

In any event, stripping all constraints out of the data model allows nuBuilder to work. But it should be able to work with proper InnoDB constraints in place; they are actually useful!
:::: Jan Steinman EcoReality Co-op ::::
EcoReality
 
Posts: 26
Joined: Wed Feb 15, 2017 5:20 pm
Location: Salt Spring Island, British Columbia, Canada

Re: Subform never completes save

Postby admin » Sat Feb 25, 2017 8:39 am

Jan,

If constraints are used in your DB it will break.

nuBuilder will just use the tables and handle validation its self.

Steven
admin
Site Admin
 
Posts: 3223
Joined: Mon Jun 15, 2009 9:53 am

Re: Subform never completes save

Postby EcoReality » Mon Mar 20, 2017 2:02 am

admin wrote:If constraints are used in your DB it will break.


Are there any work-arounds? Can we keep InnoDB relations if we set the constraint to NULL?

Are there any plans to fix this bug? Would you like some help? I've done many years of PHP...

This seems like a huge issue to me. Anytime I have a foreign key, I use InnoDB relationships. It guarantees referential integrity. Many, many third-party tools (DB diagrammers, code analyzers, etc.) are dependent on InnoDB relationships. For example, Querious (https://www.araelium.com/querious/) will draw me a complete, FK-linked entity-relationship diagram with InnoDB relationships, but it only shows a bunch of isolated tables without.

You have an awesome tool, and I realize it is designed primarily to meet your consulting needs. Please consider how properly supporting InnoDB relationships might extend your own use of this tool!
:::: Jan Steinman EcoReality Co-op ::::
EcoReality
 
Posts: 26
Joined: Wed Feb 15, 2017 5:20 pm
Location: Salt Spring Island, British Columbia, Canada

Re: Subform never completes save

Postby admin » Fri Mar 31, 2017 2:07 pm

Jan,

If you use any type of constraint, you are on your own.

Steven
admin
Site Admin
 
Posts: 3223
Joined: Mon Jun 15, 2009 9:53 am


Return to General



cron