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

Amigo 2019-08-06 08:55:01 +02:00
parent c3fb2a8869
commit 9f54c096ce

@ -30,13 +30,13 @@ A number of scripts had been added that can be looked at on GitHub. While this r
[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.
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 this change had been made, and 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
[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.<<<<<
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. [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.<<<<<