Page 1 of 2

Primary Keys are removed

Posted: Wed Jan 05, 2022 4:48 pm
by oli
After the upgrade I faced another issue:
It seems that all Primary Keys are removed on all forms and it's not possible to add the Primary Key anymore.
Screenshot.PNG

Re: Primary Keys are removed

Posted: Wed Jan 05, 2022 5:15 pm
by kev1n
The primary key information is retrieved from the db and then displayed. So there is no need anymore to enter/select it manually. I will try to replicate your issue.

Re: Primary Keys are removed

Posted: Wed Jan 05, 2022 5:26 pm
by oli
The issue I'm facing is that I cannot change any form setting since I'm getting the error:
Primary Key cannot be blank.

Workaround is to change the property of the field "Primary Key" to editable and to fill in the information manually.
After that it's possible to save the changes of the form one time.

Re: Primary Keys are removed

Posted: Wed Jan 05, 2022 5:43 pm
by kev1n
Can you verify that the Primary Key's Input Type is Display and that SQL is there in the tab Display?
pk.jpg

Re: Primary Keys are removed

Posted: Wed Jan 05, 2022 5:54 pm
by oli
Yes. Seems to be correct. But the field "Primary Key" is empty.
Screenshot.PNG

Re: Primary Keys are removed

Posted: Wed Jan 05, 2022 5:59 pm
by kev1n
Do you see any errors in nuDebug Results?

Re: Primary Keys are removed

Posted: Wed Jan 05, 2022 6:01 pm
by oli
Unfortunately not.
nuDebug Log is empty.

Re: Primary Keys are removed

Posted: Wed Jan 05, 2022 6:08 pm
by kev1n
It's strange. There is no issue with 4 completely different nuBuilder installations on different hosts, versions etc.

As a quick fix, run this SQL to turn the PK field back to a text/input field.

Code: Select all

REPLACE INTO `zzzzsys_object` (`zzzzsys_object_id`, `sob_all_zzzzsys_form_id`, `sob_all_table`, `sob_all_type`, `sob_all_id`, `sob_all_label`, `sob_all_zzzzsys_tab_id`, `sob_all_order`, `sob_all_top`, `sob_all_left`, `sob_all_width`, `sob_all_height`, `sob_all_cloneable`, `sob_all_align`, `sob_all_validate`, `sob_all_access`, `sob_all_event`, `sob_all_style_type`, `sob_all_style`, `sob_calc_formula`, `sob_calc_format`, `sob_run_zzzzsys_form_id`, `sob_run_filter`, `sob_run_method`, `sob_run_target`, `sob_run_type`, `sob_run_id`, `sob_display_sql`, `sob_select_multiple`, `sob_select_2`, `sob_select_sql`, `sob_lookup_code`, `sob_lookup_description`, `sob_lookup_description_width`, `sob_lookup_autocomplete`, `sob_lookup_zzzzsys_form_id`, `sob_lookup_javascript`, `sob_lookup_php`, `sob_lookup_table`, `sob_subform_zzzzsys_form_id`, `sob_subform_foreign_key`, `sob_subform_add`, `sob_subform_delete`, `sob_subform_type`, `sob_subform_table`, `sob_input_count`, `sob_input_format`, `sob_input_type`, `sob_input_javascript`, `sob_input_datalist`, `sob_input_attribute`, `sob_html_code`, `sob_html_chart_type`, `sob_html_javascript`, `sob_html_title`, `sob_html_vertical_label`, `sob_html_horizontal_label`, `sob_image_zzzzsys_file_id`) VALUES ('nu5bad6cb326ddb36', 'nuform', 'zzzzsys_form', 'input', 'sfo_primary_key', 'Primary Key', 'nu5bad6cb36791fd5', '70', '183', '182', '285', '22', '1', 'left', '0', '0', '1', NULL, NULL, '', '', '', '', '', 'n', NULL, '', 'SELECT column_name\r\nFROM information_schema.columns\r\nWHERE table_name = \'#sfo_table#\'\r\nAND table_schema = database()\r\nAND COLUMN_KEY = \'PRI\'', '', '0', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '0', '', 'text', '', NULL, NULL, '', '', '', '', '', '', '')

Re: Primary Keys are removed

Posted: Wed Jan 05, 2022 6:28 pm
by oli
Thank you! This solved the problem.

Re: Primary Keys are removed

Posted: Wed Jan 05, 2022 6:34 pm
by kev1n
Somehow I would still have to find out why it is not displayed for you...