• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

clone/copy register but select wich fields

rtorres

Member
HI!

I activated the copy button, and works ok... where do i need to modify the code so that only certain elements are copied to the new record and not all the fields??

it can be that i have access to the elements values .. then change them individually and save them....

thanks!
 
ok let me explain... the information that my users need to enter in some cases involves entering the same base information used in the last record, to prevent the user to enter all the fields again I used the copy button so they only need to modify that particular record (about 7 fields/elements), ...

what i need is to be able to copy/clone the register but only the fields/elements that i want, in this way the user only update the "empty" elements...

i was thinking in modifing the code yes.. but is there another way? to achive this?
 
I fully understand the need for this - which is why I added these changes to Github back on July 2nd.
(Pull Requests #1838-1841)
This allows you to specify which fields/columns values should be "reset to default" when copied via the Fabrik List Copy plugin.
That's basically what you want to do, no?

So all I can say is, Me too!!! :D
Maybe now that someone else has/sees a need for this, Hugh will merge those pull requests.;)
 
@Bauer - that was another one where it was multiple PR's with with multiple commits on the same file in the same PR. When I start looking at those, I just move on to something else. For future reference, the way to do it is:

When you start work on a new feature, on your fork, create a new branch. Edit your files, and test. Don't commit anything until you are sure everything is working. Even when you are sure, test for a few more days. THEN hit commit, push and create the PR. I'm not sure how you work, whether you have an IDE locally, and set up and 'upstream' remote pointing at the Fabrik repo, or whether you manually do the PR's from the github web UI. So exactly how you submit the PR depends on that.

This way, there's only one commit on each file (not a series of commits that change the same lines of code multiple times), and they are all collected in one PR, and with one click I can merge it into a "feature branch" on my end, and see all the changes. With multiple PR's, it makes it really hard for me to create a feature branch where I can test your changes, before actually merging them into the live code. And because I'm a) lazy and b) very busy, if something is Really Hard, I tend to procrastinate.

I'm more than happy to help tutor you on github usage - I've offered before.

BTW - he seems to be talking about the "Copy" button on the form, not a list a copy.

-- hugh
 
Believe me Hugh, I've tried doing it so its all one commit - many times. Maybe with your step by step instructions I'll finally get it figured out, Thanks:)

When I use github I just test the code for a few days on the (remote) server hosting my project (that I edit via Filezilla) then paste it into Fabrik Github code via their editor.
My problem with making commitments (like a tutorial) is that I can't predict if I will be physically/mentally able to do anything at any set time. It's why I haven't had a real job for decades now.

Yeah, I'm just realizing rtorres is talking about the form copy button - thanks for pointing that out. But this would work for that purpose. As a matter of fact this tweak to the list copy plugin was remarkably easy to accommodate into the existing Fabrik code. (The default values are already 'known' so it was just a matter of using them for any elements configured in the 'use defaults' array.)

I'll try to get to this yet today - or tomorrow.
 
Last edited:
I have similar issues - I deal with lifelong chronic pain, and my hours are erratic, depending on whether I've slept or can work through the fog. So I'm quite happy to work round your schedule. Just ping me when you have some time, and if I'm available, I'll help. Skype is probably the best bet for doing this kind of stuff.

I'm buried in some custom coding atm, but if I get time today I'll see if I can merge that list copy PR without too much farting around.

-- hugh
 
Yes, once I get the time to merge that PR. Note that it would only work for the list copy plugin, not the copy button on the form.

-- hugh
 
@Bauer - you know, the more I think about it, the more I think the better way to implement this would be to have a new setting on elements, 'Use default on copy', which would then apply to both the list plugin and "save as copy" from the form.

-- hugh
 
@Bauer - I went ahead and implemented this using a new setting for elements ("Default on Copy"), which works for both list copy and form save-as-copy.

For Reasons, the new setting wound up under the Access tab. It couldn't go in the main settings (name, label, etc) or Publishing, or anywhere more obvious because it as to be in one of the tab groups in the "params" fields (ones which are encoded into the params field in the metadata, rather than having their own column). And I couldn't put it with the normal "Default" setting, as that would have meant adding the param to every single plugin's XML. So it was a choice between "List Settings", "Access" and some even less obvious places.

-- hugh
 
@rtorres - so to achieve what you want, do a full github update, then for the elements which you do NOT want copied, go to the Access tab in the element settings and set "Default on Copy" to "Yes". Those elements will then not inherit the copied values, they'll use their normal default value.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top