diff --git a/041-Upgrade-to-JCB-v2.5.8-and-using-the-new-Admin-View-and-Admin-Fields.md b/041-Upgrade-to-JCB-v2.5.8-and-using-the-new-Admin-View-and-Admin-Fields.md index 2e09023..9482cde 100644 --- a/041-Upgrade-to-JCB-v2.5.8-and-using-the-new-Admin-View-and-Admin-Fields.md +++ b/041-Upgrade-to-JCB-v2.5.8-and-using-the-new-Admin-View-and-Admin-Fields.md @@ -1 +1,45 @@ -Hi I've got Joomla Installed here with JCB Joomla component Builder 2.5.6 [00:00:12](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h00m12s) I've got quite a lot of components That I have Imported From another day JCB And Basically all of it is working If we were to look Inside of them It really looks the way that it should And it's expected [00:00:34](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h00m34s) Now Joomla has Conveniently Decided to Get rid of this repeatable Field Which pops up into a little Model And So we have systemically been removing this field [00:00:54](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h00m54s) From JCB Just to show you We've already done that in other areas of JCB Like in the language area If we would to Open Any of these Language strings You see that we already have the repeatable field [00:01:19](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h01m19s) Set up here Now This would have been a simple as changing the field type Within JCB to achieve Only Reality is that the compiler As well as one other feature which is the Joomla components Can be exported in JCB packages and imported And so These features are mapping into these component concepts [00:01:46](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h01m46s) You know the Field structures really how data stored In a json By the repeatable fields Are different from how it's being stored in the subform fields Are gonna go into explaining what the difference is There is actually Few tickets been open on GitHub about this And so We have [00:02:10](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m10s) Taken on the task of just Sporting all of this With this next release which is JCB 2.5.8 The whole admin View area Will now be moved over to this new form Subform layout So if I was to open an admin View now It basically has The old Repeatable field concept As you would have learned with all the tutorials we've done [00:02:43](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m43s) So your permissions is one of those taps the fields The conditions the linked fields And then you have a list of the fields that are linked to the admin View And you've got some custom buttons you could Setup and it's also A Repeatable field As well as linking a sequel Clicking on table this is also repeatable field In a model [00:03:13](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m13s) So all of these different fields are now gonna be moved to subfields Because of space and statistics We will Move some of these Fields into taps I will try and do it in a way that seems obvious and that he wouldn't feel lost So just up front The fields This Fields button Are going to be moved To the fields tab [00:03:45](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m45s) And so does The conditions move there There will be in new tab called settings so basically this tab will stay there And will call that details and a new tab with settings And the rest of the repeatable fields that are remaining On this side will be placed there Ok so that's just a heads up on what's gonna happen But this is gonna happen really without you doing much Basically all you need to do is upgrade And [00:04:19](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m19s) We have added a number of scripts That you can actually go and look at On GitHub if you like As I'm doing this recording The staging branch Is where you will see these changes So Basically if we would to go to the script This is the script that will Convert [00:04:43](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m43s) The Fields and all the tables and everything So let me just go down to that area So here we have a function Inside of a method More like an anonymous function And Basically this is what converts the repeatable fields So I'll be using this function over and over As you can see we've done It with a upgrade to version 2.5.5 [00:05:13](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m13s) And Then there is another upgrade 2.7 which was not really released because having made this This change We still need to to convert the repeatable fields And that will continue to run until 2.5.9 Now The way it does this Is it really Targets The various [00:05:40](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m40s) Up here There's to convert repeatable function it Target all these fields as you can see Inside the admin View And it passes it over to this Convert repeatable Which is really going to do the work and this function Like I said you can look at it Over here If you are uncertain of doing this [00:06:07](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m07s) You can come and look at this function here And I will now also demonstrate that it actually does work well The only thing that I have actually noticed It's like with this website that we are working on here We talking about thousands of values Well Even more than thousands And I have found that [00:06:32](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m32s) It sometimes does not convert every single value And so because of that We actually did another fix Which Goes beyond and ensures that this upgrade will not cause any Internal conflicts And that is within the Backend And within the model There are a few places where these New fields will now exist [00:07:02](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m02s) One of them is conditions Field conditions and the other one is admin Fields so I'll open that one Open this one And obviously in a Oh not Not that one It's this admin View These are the models in which these field changes will take place And you'll see that within the [00:07:27](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m27s) Get item Method at the very end Of this method In the admin View We added a function Which would basically check If this These Fields were updated during the upgrade And if it were not updated That is while the field is busy loading and you're opening the page [00:07:52](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m52s) It'll check whether it's been updated If it's not updated it will actually make Do the update And add it to the update object And then basically check every field All the way down Till here And then if it sees that there is been any one of those fields Found to be You know ready to update [00:08:14](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m14s) Then we will run the update And after that it will never Do it again Because you see the way the A the array is constructed This Will no longer exist once it's been moved to a subform Storage The subform array structure is different So [00:08:39](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m39s) Once you open any of the items it will automatically convert it and make sure that it's Converted The other thing that we've done Because you most probably will not all open every view or every Admin View Is Even when the new admins Fields we've done the same So you can see here In the Admin Fields we are also making sure that that update is there And the same with the Admin field conditions [00:09:09](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m09s) It's also there But then there is one more place where we also add these Checks and that's actually in the compiler So even if you didn't go and open any of these views and you just went straight to the compiler And try to compile any of your components The compiler obviously now been adapted to instead Actually Use the new subform structure Within it's compilation [00:09:38](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m38s) To within the get file where most of these subforms are now needed We have In the get admin Function let me just get there So here is the get admin View Method of function class method And you see we are checking Whether it's still in a repeatable field And if it is We convert it [00:10:04](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m04s) And we again store it to the update object That While it's getting this one Admin view at the very end So every where it's doing it check If it's not being converted converts it's sets it back to the data set And also to ensure that we store it back into the database Little String And So It Goes On Doing it everywhere Where we [00:10:30](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m30s) You know expect To find values that still You know me I've been missed And then here it very end of this function Which is a little big I supposed If we found that there are any updates we run the update And after that that view is been updated and it will never need to be updated again so these are the Kind of Switches [00:10:56](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m56s) How can I put it Fixes really That we put in place when you already have a JCB with horrendous amount of Data and it is just too big to do just with the normal install Then all these admin views will Be Updated and adapted As you start using JCB And you should not really anywhere at any time experience Any conflicts [00:11:27](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m27s) In fact if you do the reason for me making this tutorial Is it you can actually get into the code And that you can You know Open an issue on GitHub And give me heads up so I can You know Patch whatever you find And push it out the rest the community Ok so that was just a code side of things now getting back to to our install here [00:11:53](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m53s) I think what I'll do is I'll just open Maybe this Admin view And then I'm gonna go And Basically Install The The upgrade [00:12:11](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m11s) I'm just gonna selected it's not been released yet So this is a pre-demostration Just to ensure everything works So if it doesn't you even see that So let's just select this file from my computer Ok there it goes busy installing it It should take a while it's quite a big dataset And you can just wait it out I'd wouldn't shout at you if it missed certain values I don't know why doesn't but [00:12:47](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m47s) there it goes Your upgrade is been successful And you are now on version 2.5.8 And if we were to open that Admin view Which Basically looked Like this And now just refresh it It should now look like that So you see it's moved [00:13:09](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m09s) These Fields to the side There's now a settings field And as you can see all the data is just been updated and moved to subform values Same with the taps And if we go to field and conditions There we go That's how the new field and conditions view looks like Now Because of many reasons we couldn't keep the subform fields within the admin View [00:13:38](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m38s) Especially when you Start having More than 50 admin Fields which in my case I have quite a few of those it's not advisable Because it actually causes the tremendous Slow down on page load I mean imagine each of these lines are actually 1 2 3 4 5 6 7 8 9 10 11 12 13 fields And if you start having a huge a lot of those fields Which you could have up to 800 [00:14:09](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m09s) By the limit we've set it really takes a long time to load that into the page Ok Enough about that how does it work now Well you could either click on this edit button here Or this edit button here to actually go and edit these and change their values If you would like to just edit one specific field You could click on any of these you know pencil editing Links So for example if I click on name [00:14:41](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m41s) It will ask me whether I've saved all my values in this current View And yes I just click ok And it will now open the name field And I can now come in here do any edits that I'd like And then save and close or just close out again if you wanna only wanna get some information Now Back into This area The same goes with the custom Fields I could click on any of those to edit them Or I could click on this edit here [00:15:12](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m12s) And it will again ask me if I saved all my work And then if I did click ok And opens Those values right here A nice new tweak with added is that it only loads the fields That are actually linked to this Admin view So that you can only Target The specific fields [00:15:34](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m34s) Which really makes sense That Those are the fields that needs to be targeted With this conditional option Then you could also create a field but creating a field will not Necessarily add it to the admin View It will just make it available to you If you were to have You know add it By going to admin fields [00:15:57](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m57s) Oh yes let me just say this this button here And this one here is the same button Just this is a shortcut Because sometimes you might have a lot of fields And it's a way down there to get to conditions So we added some shortcuts up here There's also the tutorial On how to use this but the tutorial still was made when we had the old Fields layout It should still make sense I mean you just need to keep in mind that things change a little So you could click here [00:16:27](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h16m27s) On any of these links To actually open That area where the fields are now found And make the changes So that's really the new admin Fields and moving away from repeatable fields To start using subforms for all our Repeatable concepts It's really what This upgrade is all about [00:16:53](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h16m53s) There is 1 heads up which I know is little different to how things were done previously Let me just close out of this Admin View Oh yes I could just mention this Here is a shortcut to get to the admin Fields without opening the admin view and then opening the admin fields You can click on this right here and it will automatically take you to the admin fields And you can make changes here [00:17:21](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h17m21s) And obviously it's link to the look Area or the look admin view And the same is true when looking at The conditions there the second button here is for conditions The thing that has changed is if you create a new admin View Now You would obviously add the single record name the list record name the short description And the system name And that's really all you need to add [00:17:51](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h17m51s) To save the admin view for the first time because The admin view at this stage It cannot be linked to any Fields until it has an ID Now I might still work on this and try and You know Tune it in a way that When you click the button and if the Admin view is not saved it saves it for you But [00:18:15](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h18m15s) I haven't done that yet so at this stage Since the admin field doesn't have an ID it's still new because we haven't clicked save Even once You can't link any Fields to them To it so what you would Natural do is just add some Add some name here And And then just save it once And having done that if you now go to Fields and conditions [00:18:57](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h18m57s) It basically says create To this button here and that one here is the same button You can click on any of them to create fields So if you would create a field So yes I did save everything And then I You can just click on this plus over here And there's a first field and you can start you know adding fields And tweak them as you would before [00:19:22](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h19m22s) And Yep so there you go That's the new subform Fields for admin views And that's what this upgrade is really all about I trust that it all benefit all of us in the future And make it more easier for us to transition into Joomla 4 And thank you for watching. +# UPGRADING TO JCB v2.5.8 AND USING THE NEW ADMIN VIEW AND ADMIN FIELDS + +### JCB removing Repeatable Fields + +Hi. I've got Joomla installed here with JCB Joomla Component Builder 2.5.6 [00:00:12](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h00m12s) I've got quite a lot of Components that I have imported from another JCB. All of it is working. If we were to look inside of them, it looks the way that it should, and as expected. [00:00:34](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h00m34s) Joomla has conveniently decided to get rid of this Repeatable Field, which pops up into a little model. We have systemically been removing this Field [00:00:54](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h00m54s) from JCB. We've already done that in other areas of JCB. Like in the Language Translation area. If we would to open any of these Language strings'(a'-ZA.ng-NA)Demo-used in 21', you will see that we already have the Repeatable Field [00:01:19](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h01m19s) set up. + +### Compiler, Other Components in Joomla Can Export And Import IN JCB Packages + +This would have been simple as changing the Field Type within JCB to achieve. The only reality is that the Compiler as well as one other feature which is the Joomla Components, can be exported and imported in JCB Packages. These features are mapping into these Component concepts, [00:01:46](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h01m46s) the Field structures, how data is stored in a json. The Repeatable Fields are different from how it's being stored in the Sub Form Fields. + +### Difference Between Repeatable Fields And Sub Form Fields + +I'm going to explain what the difference is. There is few tickets open on GitHub about this. We have [00:02:10](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m10s) taken on the task of supporting all of this. With this next release which is JCB 2.5.8, the whole Admin View area will be moved over to the new Sub Form layout. If I was to open an Admin View - Look, it has the old Repeatable Field concept as you would have learned with all the tutorials we've done. [00:02:43](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m43s) Your permissions is one of those tabs, the Fields, the Conditions, the Linked Views. Then you have a list of the Fields that are linked to the Admin View. You've got some Custom Buttons you could setup, and it's also a Repeatable Field, as well as linking MySQL, clicking on Table. This is also repeatable Field in a model. [00:03:13](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m13s) + +### Heads Up - Moving And Changing Of Fields + +All of these different Fields are going to be moved to Sub Fields, because of space and statistics. We will move some of these Fields into tabs. I will try and do it in a way that you wouldn't feel lost. Up front this Fields Button are going to be moved to the Fields Tab. [00:03:45](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m45s) The conditions are going to be moved. There will be in new tab called Settings. Settings tab will be call Details, and a new tab will be Settings. The rest of the Repeatable Fields that are remaining on this side will be placed there.That's just a heads up on what's going to happen. This is going to happen without you doing much. All you need to do is upgrade. [00:04:19](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m19s) + +### Add Number Of Scripts That Will Convert + +We have added a number of scripts that you can go and look at on GitHub if you like. As I'm doing this recording, the Branch: staging is where you will see these changes, if we would to go to the script, this is the script that will convert [00:04:43](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m43s) the Fields and all the Tables and everything. + +### Convert Repeatable Function + +Let me just go down to that area. We have a function inside of a method. More like an anonymous function. This is what converts the Repeatable Fields. We'll be using this function over and over as you can see we've done it with a upgrade to version 2.5.5 [00:05:13](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m13s) and then there is another upgrade 2.5.7 which was not released because having made this change, we still need to convert the Repeatable Fields. That will continue to run until 2.5.9. The way it does this, [00:05:40](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m40s) the '$convertRepeatable' function target all these(ajax, custom_button, addtables etc.) fields inside the Admin View, and it passes it over to '$convertRepeatable', which is going to do the work and '$convertRepeatable' function like I said you can look at it over here. If you are uncertain of doing this [00:06:07](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m07s) you can come and look at '$convertRepeatable' function here. I will also demonstrate that it does work well. The only thing that I have noticed, it's like with this website that we are working on, we talking about thousands of values, even more than thousands. + +### Model - admin_view.php - Changes Would take Place + +I have found that [00:06:32](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m32s) it sometimes does not convert every single value, and because of that, we did another fix, which goes beyond and ensures that this upgrade will not cause any internal conflicts. That is within the Back end, and within the Model. There are a few places where these new Fields will exist. [00:07:02](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m02s) One of them is 'admin_field_conditions.php' and the other one is 'admin_view.php'. I'll open this 'admin_view.php'. These are the models in which these Field changes will take place. You'll see that within the [00:07:27](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m27s) getItem Method at the very end of this method in the Admin View, we added a function which would check if this these Fields were updated during the upgrade. And if it were not updated, while the field is busy loading and you're opening the page. [00:07:52](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m52s) it'll check whether it's been updated. If it's not updated it will make do the update, and add it to the update object. And then check every Field, all the way down. If it sees that there is been any one of those Fields found to be ready to update, [00:08:14](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m14s) then we will run the update. After that it will never do it again. The way the array is constructed, this will no longer exist once it's been moved to a Sub Form Storage. The Sub Form array structure is different. [00:08:39](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m39s) Once you open any of the items, it will automatically convert it and make sure that it's converted. + +### Checks - Converts Sets Back In Database - Updated Once Never to Do It Again + +The other thing that we've done, because you most probably will not open every view or every Admin View. Even in the new admins fields we've done the same. In the admin fields, we are also making sure that that update is there, and the same with the admin field conditions, [00:09:09](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m09s) it's also there. But there is one more place where we also add these checks and that's in the Compiler. So even if you didn't go and open any of these views and you just went straight to the Compiler, and try to compile any of your Components, the Compiler now been adapted to instead use the new Sub Form Structure within it's compilation. [00:09:38](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m38s) + +* ### Checking + +Within the Get file where most of these sub forms are now needed, we have in the 'getAdminViewclass' method and you will see we are checking whether it's still in a Repeatable Field. If it is, we convert it. [00:10:04](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m04s) Again store it to the update object while it's getting this one admin view at the very end. Every where it's doing it check, if it's not being converted. + +* ### Converts + +It converts it and sets it back to the data set, and to ensure that we store it back into the database, this little string '$objectUpdate->addpermissions=json_encode($bucket);. So it goes on doing it everywhere where we [00:10:30](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m30s) expect to find values that still may have been missed. + +* ### Updates +?? +And at the very end of this function, which is big I supposed. If we found that there are any updates we run the update, and after that view is been updated, it will never need to be updated again. These are the kind of [00:10:56](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m56s) How can I put it Fixes really That we put in place when you already have a JCB with horrendous amount of Data and it is just too big to do just with the normal install Then all these admin views will Be Updated and adapted As you start using JCB And you should not really anywhere at any time experience Any conflicts [00:11:27](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m27s) In fact if you do the reason for me making this tutorial Is it you can actually get into the code And that you can You know Open an issue on GitHub And give me heads up so I can You know Patch whatever you find And push it out the rest the community Ok so that was just a code side of things now getting back to to our install here [00:11:53](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m53s) I think what I'll do is I'll just open Maybe this Admin view And then I'm gonna go And Basically Install The The upgrade [00:12:11](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m11s) I'm just gonna selected it's not been released yet So this is a pre-demostration Just to ensure everything works So if it doesn't you even see that So let's just select this file from my computer Ok there it goes busy installing it It should take a while it's quite a big dataset And you can just wait it out I'd wouldn't shout at you if it missed certain values I don't know why doesn't but [00:12:47](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m47s) there it goes Your upgrade is been successful And you are now on version 2.5.8 And if we were to open that Admin view Which Basically looked Like this And now just refresh it It should now look like that So you see it's moved [00:13:09](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m09s) These Fields to the side There's now a settings field And as you can see all the data is just been updated and moved to subform values Same with the taps And if we go to field and conditions There we go That's how the new field and conditions view looks like Now Because of many reasons we couldn't keep the subform fields within the admin View [00:13:38](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m38s) Especially when you Start having More than 50 admin Fields which in my case I have quite a few of those it's not advisable Because it actually causes the tremendous Slow down on page load I mean imagine each of these lines are actually 1 2 3 4 5 6 7 8 9 10 11 12 13 fields And if you start having a huge a lot of those fields Which you could have up to 800 [00:14:09](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m09s) By the limit we've set it really takes a long time to load that into the page Ok Enough about that how does it work now Well you could either click on this edit button here Or this edit button here to actually go and edit these and change their values If you would like to just edit one specific field You could click on any of these you know pencil editing Links So for example if I click on name [00:14:41](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m41s) It will ask me whether I've saved all my values in this current View And yes I just click ok And it will now open the name field And I can now come in here do any edits that I'd like And then save and close or just close out again if you wanna only wanna get some information Now Back into This area The same goes with the custom Fields I could click on any of those to edit them Or I could click on this edit here [00:15:12](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m12s) And it will again ask me if I saved all my work And then if I did click ok And opens Those values right here A nice new tweak with added is that it only loads the fields That are actually linked to this Admin view So that you can only Target The specific fields [00:15:34](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m34s) Which really makes sense That Those are the fields that needs to be targeted With this conditional option Then you could also create a field but creating a field will not Necessarily add it to the admin View It will just make it available to you If you were to have You know add it By going to admin fields [00:15:57](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m57s) Oh yes let me just say this this button here And this one here is the same button Just this is a shortcut Because sometimes you might have a lot of fields And it's a way down there to get to conditions So we added some shortcuts up here There's also the tutorial On how to use this but the tutorial still was made when we had the old Fields layout It should still make sense I mean you just need to keep in mind that things change a little So you could click here [00:16:27](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h16m27s) On any of these links To actually open That area where the fields are now found And make the changes So that's really the new admin Fields and moving away from repeatable fields To start using subforms for all our Repeatable concepts It's really what This upgrade is all about [00:16:53](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h16m53s) There is 1 heads up which I know is little different to how things were done previously Let me just close out of this Admin View Oh yes I could just mention this Here is a shortcut to get to the admin Fields without opening the admin view and then opening the admin fields You can click on this right here and it will automatically take you to the admin fields And you can make changes here [00:17:21](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h17m21s) And obviously it's link to the look Area or the look admin view And the same is true when looking at The conditions there the second button here is for conditions The thing that has changed is if you create a new admin View Now You would obviously add the single record name the list record name the short description And the system name And that's really all you need to add [00:17:51](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h17m51s) To save the admin view for the first time because The admin view at this stage It cannot be linked to any Fields until it has an ID Now I might still work on this and try and You know Tune it in a way that When you click the button and if the Admin view is not saved it saves it for you But [00:18:15](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h18m15s) I haven't done that yet so at this stage Since the admin field doesn't have an ID it's still new because we haven't clicked save Even once You can't link any Fields to them To it so what you would Natural do is just add some Add some name here And And then just save it once And having done that if you now go to Fields and conditions [00:18:57](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h18m57s) It basically says create To this button here and that one here is the same button You can click on any of them to create fields So if you would create a field So yes I did save everything And then I You can just click on this plus over here And there's a first field and you can start you know adding fields And tweak them as you would before [00:19:22](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h19m22s) And Yep so there you go That's the new subform Fields for admin views And that's what this upgrade is really all about I trust that it all benefit all of us in the future And make it more easier for us to transition into Joomla 4 And thank you for watching.