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

Amigo 2019-08-06 08:40:10 +02:00
parent 33525c14ca
commit c3fb2a8869
1 changed files with 13 additions and 6 deletions

@ -18,21 +18,28 @@ There is few issues open on GitHub concerning this. [00:02:10](https://www.youtu
[00:03:13](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m13s)
All of these different Fields are going to be moved to Sub Fields, because of space and statistics, some of these Fields will be moved into tabs. It will be done in a way that you will not feel lost. Up front this Fields Button are going to be moved to the Fields Tab and so are the Conditions going to be moved there.[00:03:45](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m45s) There will be a new tab called 'Settings'. <<<<<<<<
All of these different Fields are going to be moved to Sub Fields, because of space and statistics, some of these Fields will be moved into tabs. It will be done in a way that you will not feel lost. Up front this Fields Button are going to be moved to the Fields Tab and so are the Conditions going to be moved there.[00:03:45](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m45s) There will be a new tab called 'Settings'. The Settings tab will be called Details. The rest of the Repeatable Fields that are remaining on this side will be placed there. That's just a heads up on what is going to happen. There is not much for you to do except to upgrade.
Settings tab will be called 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 Fields and Tables etc.
### Add Number Of Scripts That Will Convert
[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 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.
A number of scripts had been added that can be looked at on GitHub. While this recording had been done this changes could have be seen at the 'Branch: staging',(See video) and if we would to go to the script, the script may be seen that will convert 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.
[00:04:47](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m47s)
Scrolling down to that area a function inside of a method may be seen. It is more like an anonymous function. This is what converts the Repeatable Fields.[00:05:04](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m04s) This function will be used repeatedly as had been done with a upgrade to version 2.5.5 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. [00:05:31](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m31s)(See video) The way it does this, 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 as may be seen over here. If you are uncertain of doing this you can come and look at '$convertRepeatable' function here.[00:06:07](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m07s) It will be noticed, as with this website that we are working on, that there are thousands of values.
### 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.
[00:06:30](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m30s)
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. You'll see 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 sees that there is been any one of those Fields found to be ready to update, then we 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. [00:08:39](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m39s) 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