Updated 041 Upgrade to JCB v2.5.8 and using the new Admin View and Admin Fields (markdown)

Amigo 2019-08-07 09:30:43 +02:00
parent 20a98708c6
commit f588e128c1
1 changed files with 12 additions and 6 deletions

@ -38,7 +38,7 @@ Scrolling down to that area a function inside of a method may be seen. It is mor
I have found that it sometimes does not convert every single value, and because of that, another change was necessary, which goes beyond and ensures that this upgrade will not cause any internal conflicts. That is within the Back end, 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'. If this 'admin_view.php' is opened, these models in which these Field changes will take place is seen. It may be seen that within the 'getItem Method' at the very end of this method in the Admin View, a function was added which would check if this these Fields were updated during the upgrade. [00:07:27](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m27s) If it were not updated, while the field is busy loading and you are opening the page, it will check whether it has been updated. [00:07:52](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m52s) If it is not updated it will do the update, and add it to the update object and then check every Field, all the way down. If it detects that there has been any one of those Fields found ready to be updated, then it will run the update.[00:08:14](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m14s) After that it will never do it again. The way the array is constructed, will no longer be seen once it has been moved to a Sub Form Storage, seen that the Sub Form array structure is different. Once any of the items are opened, it will automatically be converted and ensure that it is converted.
### Checks - Converts Sets Back In Database - Updated Once Never to Do It Again
### Checks - Converts - Updates
[00:08:46](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m46s)
@ -56,19 +56,25 @@ Within the Get file where most of these sub forms are now needed, we have in the
[00:10:15](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m15s)
It converts it and sets it back to the data set, and this string '$objectUpdate->addpermissions=json_encode($bucket);is used to ensure that it gets stored in the database. So it does everywhere where values still may be expected to have been missed. <<
It converts it and sets it back to the data set, and this string '$objectUpdate->addpermissions=json_encode($bucket);is used to ensure that it gets stored in the database. So it does everywhere where values may have been missed.
* ### Updates
* ### Updates- never need to be updated again
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) Fixes that we put in place when you already have a JCB with horrendous amount of data. It is just too big to do the normal install, then all these admin views will be updated and adapted as you start using JCB. And you should not 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 that you can get into the code. Open an issue on GitHub, and give me heads up so that I can patch whatever you find, and push it out to the rest of the Community. That was just a code side of things.
[00:10:35](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m35s)
If any updates are found at the very end of this function, a update should be run, and after that view has been updated, it will never need to be updated again. These are the kind of mechanisms that had been put in place if you have a JCB with a huge amount of data which is to much for a normal install. Then all these Admin views will be updated and adapted as you start using JCB and there should not be any conflicts. [00:11:27](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m27s) If you do experience conflicts, open an issue on GitHub, so that I can do the necessary adjustments.
### Installing The Upgrade v2.5.8
Getting back to our install. [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 this Admin View - Look, and then I'm going to go and install the upgrade. [00:12:11](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m11s) I'm just going to select it, it's not been released yet, so this is a pre-demostration. Just to ensure everything works, if it doesn't, you even see that. Let's just select this file from my computer. There it goes, busy installing it. It should take a while, it's quite a big data set. You can just wait it out. [00:12:47](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m47s) Your upgrade is been successful. You are now on version 2.5.8.
[00:11:50](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m50s)
Getting back to the Install. Open this Admin View - 'Look', and then install the upgrade. Select it, it has not been released yet, so this is a pre-demostration. A file is selected from my computer(See video). Since it is quite a huge data set it may take a while for the installation to be completed. [00:12:47](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m47s) In this case the upgrade to version 2.5.8 has been successful. <<<
### New Field And Conditions View
If we were to open that Admin View which looked like this(see video) and now refresh it, it should look like that(see video). 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 Sub Form values. Same with the tabs. If we go to Field and Conditions, that's how the new Field and Conditions View looks like. Because of many reasons we couldn't keep the Sub Form 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 causes a tremendous slow down on page load. I mean imagine each of these lines are 1 - 13 Fields. If you start having 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.
[00:12:55](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m55s)
If that Admin View is opened which looked like this(see video) and now refresh it, it should look like that(see video). It has moved these Fields to the side. There is now a Settings Field and as you can see all the data is just been updated and moved to Sub Form values. Same with the Tabs. Going to Field and Conditions, that is how the new Field and Conditions View looks like. Due to many reasons we could not keep the Sub Form 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 causes a tremendous slow down on page load. I mean imagine each of these lines are 1 - 13 Fields. If you start having 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.
### How The Field And Conditions View Works?