Problem when cloning a form

Questions related to using nuBuilder Forte.

Problem when cloning a form

Postby nac » Wed Jan 31, 2018 9:15 am

Hello,

I am having a number of minor problems which may be related to the Apache/MariaDB/PHP settings and/or versions. The simplest of these to describe occurs when cloning a form. Here is what I have done to reproduce the problem. This happens consistently.

  • Create a clean installation of nuBuilder as per the instructions in the Wiki - works OK
  • Login and use the fast form builder (Builders > Fast Forms) to create a new Browse&Edit form (and data table) with two fields - works OK
  • Enter a couple of records - OK
  • Use the (Setup > Forms) button to edit the form design and clone it - at this point the cloning does not seem to work. In the cloned form the Browse function is fine; however Edit does not work.
When I look at the number of records in four of the 'zzzz' tables, I see the following:
Code: Select all
                     Baseline    After FF      After FF
                                 created        cloned
-------------------------------------------------------------
zzzzsys_form            42          43             44
zzzzsys_browse          79          81             83
zzzzsys_tab             63          64             65
zzzzsys_object         267         270            270 

The differences between the Baseline (after installation of nuBuilder) and after creating the first form all make sense. 1 new form record, 2 new browse columns, 1 new tab and 3 new objects (the 2 data fields plus the run button on the index page). However after cloning I would have expected zzzzsys_object to have 272 rows but it remains at 270. I assume this is why the cloned form does not work.

So, I have a few questions:

Am I correct in expecting there to be 272 records in zzzzsys_object after cloning?
If so, then what could be the reasons for the cloning to be incomplete?
The are no JS errors in the console (as the cloning occurs server-side, I would not expect any).
There are no (new) records in zzzzsys_debug.

The web hosting platform uses:
MariaDB 5.5.58 - Protocol version: 10
PHP version: 7.0.24 - others are available but all show the same problem.

I wonder if there are changes that need to be made in php.ini, my.cnf or other configuration files for nuBuilder to operate correctly? For some settings I may need to request the web hosting company to make changes.
Has anyone had to make such changes in order for nuBuilder to work correctly?

Finally, I installed WampServer with PHP 7.1.9 and MariaDB 10.2.8 on my PC to create an alternative test environment.
To get this working with nuBuilder I had to use sql-mode="" but after making this change I found exactly the same behaviour as described above.

There are many versions of PHP, MariaDB/MySQL and a large number of settings and so any guidance on how to resolve this would be very welcome.

Thanks in advance.

Neil
nac
 
Posts: 47
Joined: Wed Dec 13, 2017 7:58 am
Location: Aberdeen, UK

Re: Problem when cloning a form

Postby admin » Wed Jan 31, 2018 10:31 am

Neil,

You are correct when you point out that Objects don't get cloned when you clone a Form.

Version 3 was the same.

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

Re: Problem when cloning a form

Postby nac » Thu Feb 01, 2018 1:52 am

Hi Steven,

Thanks for the reply. I guess the good news is that the AMP versions/settings I am using are OK. I am really enjoying exploring nuBuilder and I plan to use it for an application I have in mind. It is very intuitive and easy to use but, in this case, my intuition clearly let me down.

Just to clarify - by design, cloning does not copy the objects on the edit form? The screen shots below show what happens when I use 'Preview Edit Form' in the original and cloned forms.

preview edit form - original.PNG
Preview edit form - original
preview edit form - original.PNG (29.14 KiB) Viewed 1015 times

preview edit form - clone.PNG
Preview edit form - clone
preview edit form - clone.PNG (37.18 KiB) Viewed 1015 times

The cloned form preview is an empty modal form because there are no object records for this form.

In order to clone the form objects, I did try the following, which seemed to work but I wonder if it could have unintended consequences. Could you advise please?

  • export the records in zzzzsys_object where sob_all_zzzzsys_form_id is the original form, as SQL INSERT statements.
  • change each zzzzsys_object_id to ensure that unique identifier are created. I changed the first three characters from 5a7 to 5a6 (in the past so safe to use?).
  • change sob_all_zzzzsys_form_id so that it uses the value for the cloned form as found in zzzzsys_form.zzzzsys_form_id .
  • change sob_all_zzzzsys_tab_id so that it uses the value(s) for the cloned form as found in zzzzsys_tab.zzzzsys_tab_id (noting there may be more than one tab).
  • run the resulting code to insert the records into zzzzsys_object .
It worked exactly as I expected with the objects on the cloned form as per the original but, as I mentioned, I am concerned this may be problematic. I noted the constant prefix of the identifier of these records and so they are easy to remove.

The other way is to open 'Form Object List' on the original form and clone each object reassigning it to the cloned form. This too works but would be laborious for a form with many objects.

Thanks again for your help (and patience).

Neil
nac
 
Posts: 47
Joined: Wed Dec 13, 2017 7:58 am
Location: Aberdeen, UK

Re: Problem when cloning a form

Postby admin » Thu Feb 01, 2018 3:12 am

Neil,

I'm not saying that wouldn't be a good idea. - There are a lot of things that would be a good idea.

But I'm focused on making Forte bug free at the moment. (which everyone on the forum is helping me do)

When you say...

I am concerned this may be problematic.


If you are concerned enough, you could create the code to do that yourself. (you seem to have a good grasp of what is needed)

And I will include it in nuBuilder Forte.

Like this guy did... https://forums.nubuilder.com/viewtopic.php?f=19&t=9211&p=15320&hilit=brilliant#p15317

BTW.

I read somewhere that one of the latest versions of Oracle Express, took 22 people 2 years to create.

nuBuilder Forte has taken about 2 years too, but I'm just 1 guy (with the occasional bit of help from the others in our office, when I have got stuck.)

I'm sorry if this sounds a bit harsh (I have just finished drinking a really strong coffee).


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

Re: Problem when cloning a form

Postby nac » Thu Feb 01, 2018 5:07 am

Steven,

All understood and not 'harsh' at all. There was certainly no implied criticism at all on my part; from my experience so far I think nuBuilder is brilliant both in design and implementation and I hope that I may be able to participate in some way (not least when/if I use it in my work to make a contribution as well). I have not used PHP much before but here is a good reason to get started.
As I intimated in my opening post, when the cloning behaviour was not as I expected, I wondered if there was a problem with my setup. It is all clear now. As you may have realised, I have not used any of the versions before Forte and so was not aware that the cloning process was the same in V3.
The 'problematic concern' I mentioned related to the practice of modifying the back-end tables directly rather than via the nuBuilder front-end design forms with possible result of unintended consequences. But as these cloned object records are all new and can be easily identified and removed, I think the steps I outlined should be safe.

Thanks once again.

Neil
nac
 
Posts: 47
Joined: Wed Dec 13, 2017 7:58 am
Location: Aberdeen, UK

Re: Problem when cloning a form

Postby admin » Thu Feb 01, 2018 5:09 am

.
admin
Site Admin
 
Posts: 3157
Joined: Mon Jun 15, 2009 9:53 am


Return to General