Ask Your Question
0

Input Required on No-Existing FieldL:

asked 2018-11-05 23:31:14 +0200

aghoras gravatar image

updated 2018-11-05 23:32:18 +0200

I have a Base project that connects to a MySQL database via JDBC (v5.1.45). After an upgrade to 6.1.2.1 (x64), my data entry form started to complain about "Input Required" on all my fields. So I went through all the optional fields and changed "Input Is Required" to "No" under the data tab. That fixed my problem with modifying records. But when I create new records, the form again complains about "Input required in field ..." for a field that is not on the form.

There is a table column with the same name as the field the program is complaining about but the default value (as set by the database) is always correct and does not need to be modified by the user of the form. Is there a way to fix this problem?

As a side note, I tried to add the fields to my form in hope of fixing the problem but that cause the LibreOffice Base program to crash completely. (crashreport.libreoffice.org/stats/crash_details/3aa1997c-9328-4fbb-aee1-2d07d799279c)

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
0

answered 2018-11-06 00:25:14 +0200

Ratslinger gravatar image

updated 2018-11-06 01:07:43 +0200

Hello,

Since we are dealing with an external DB, debugging is tougher as samples cannot be typically passed.

Have just installed LO v6.1.3 on Mint 18.3, have MySQL v 5.7.24 running, using JDBC 5.1.45 connector.

Set up simple table with ID (primary key), text field with input required and a default of "Here", and another text field for a name but not required as input.

Created form with individual fields. Data entry works as expected default test field always has "Here" in it & it was written to record. Deleted that required field from the form and entered new records. All still worked fine anf "here" was inserted in all records and no errors about input required.

So can't duplicate your problem which means there is more to what you may have. Don't understand something in your question. You state:

the form again complains about "Input required in field ..." for a field that is not on the form.

and in the next paragraph:

There is a table column with the same name as the field the program is complaining about

Can you clarify? May have something to do with the actual problem. And are you referring to individual field controls or a table control?

Edit:

Have tried to duplicate as best as possible but no failures. Re-created table & form including your field name. Here is result:

image description

No errors. Maybe try setting up a dummy table & form as I did and see if that works.

edit flag offensive delete link more

Comments

I'll try to clarify:My database table has columns A,B,C with C having a default value of 'X'. My form (bound to the table) only has entry fields for A and B. But when I hit save on a new record, the program complains and says: "Input Required in field 'C'. Please enter a value.

Here's a link to the actual dialog box: https://i.imgur.com/oALSvpS.png

aghoras gravatar imageaghoras ( 2018-11-06 00:43:59 +0200 )edit

I have had similar oddities while working with MySQL backend. It seems Base isn't always aware of changes made in MySQL, particularly if you make the changes through phpMyAdmin or another tool (like insert a new column or delete one). When I see weird behavior like this, I save my Base file, close out of Base entirely, then re-open the Base file. This sometimes "refreshes" all the fields & connection and everything is back to normal.

PhLo gravatar imagePhLo ( 2018-11-06 07:46:26 +0200 )edit

Thankfully most of these problems only happen in "development" or "setup" mode. Once all the fields and macros are in place, it's smooth sailing from then on. And you can rest assured that your data is safely stored outside of Base. Plus, you can access it from multiple computers simultaneously and even across the world as long as you have a computer, LibreOffice, your odb file, and an internet connection! It's why I chose LO Base. Less coding & decent user experience.

PhLo gravatar imagePhLo ( 2018-11-06 07:49:29 +0200 )edit
2

@PhLo When you have Base open and make changes in the DB through another means, to refresh, on Base main screen select the tables section. Then from menu View->Refresh Tables.

Ratslinger gravatar imageRatslinger ( 2018-11-06 16:29:11 +0200 )edit

Another clarification: I have not changed the structure of the database for years. This problem started happening after upgrading LibreOffice. It almost seems like Base is fetching a list of the all the columns in the table and is expecting them to have values entered unless they are explicitly marked as "Input not required".

aghoras gravatar imageaghoras ( 2018-11-06 16:32:22 +0200 )edit

@aghoras I would certainly like to provide you with an answer. Like you, at the beginning of my answer I first upgraded to v6.1.3 skipping a few versions (where 6.1.2 started with the required entry fix) because of the bug in Report builder. As you can see from my example, I find no problem. At this point I can only think it best to report your problem on -> Bugzilla.

Ratslinger gravatar imageRatslinger ( 2018-11-06 16:52:20 +0200 )edit

Ah, VERY familiar now. I faced the same when setting up my forms. Since @aghoras noticed it after a LO update, and his data hasn't changed - suggests a possible Base bug. I'm new to Base, didn't experience the recent change, and assumed Base always did that. Adding MySQL default field values fixed for me: default 0 (zero) or NULL for numbers depending on circumstance, default "" (empty) for strings, default NULL for foreign keys, etc. Measures shouldn't be 100% necessary, but not bad design.

PhLo gravatar imagePhLo ( 2018-11-06 23:18:44 +0200 )edit

Thanks @Ratslinger. I'll be using that View->Refresh Tables trick constantly now (as long as it works). If it doesn't work, I'll just keep restarting Base, as it's not a HUGE deal to me.

PhLo gravatar imagePhLo ( 2018-11-06 23:30:25 +0200 )edit
0

answered 2018-11-06 16:31:40 +0200

oneindelijk gravatar image

I have the same problem. I'm using tables (in a Table Control) with many fields not displayed. Only the 'timestamp' field is set as required in MySQL, but this field is set to CURRENT_TIMESTAMP when a new record is created, hence Base should not complain about it being empty, since the MySQL server will provide a value on creation. Funny enough, when I make a change in MySQL and set the 'timestamp' field to allow nulls (which I'd rather not), Base complains about the next field not having a value (i.e. 'Description') which has not set the requirement to be with a value.

It seems I can solve the issue by adding each field in the Table Control and set the value 'Required' to "no", but that is not a viable solution.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

2 followers

Stats

Asked: 2018-11-05 23:31:14 +0200

Seen: 103 times

Last updated: Nov 06 '18