You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CI4: Merge changes from the Master into #3271 #3585
#3271 was opened in August of 2021. We need to bring in changes that have been merged into the master since the branch was created. This will need to be curated because CI4 has many changes to formats and syntax. Some CI3 functions also do not exist or exist in the same way in CI4.
If it were me, I would go back to each of the commits or branches that were merged into the master, look at what changes were made and then go make the corollary changes on #3271. If we try to merge Master onto CodeIgniter_4_upgrade then go through the conflicts one at a time, it's probably just going to say everything has changed so it's indistinguishable from what is CI4 related and what is changes that are made into the master.
I think this is a good argument for freezing direct merges to the master and asking changes to be a branch of CodeIgniter_4_upgrade so they get merged into that and we don't end up with a rats nest. The more people pitching in, the faster this upgrade will be done and out the door and we won't have the crazy. At minimum, my vote is to freeze merging new branches directly into the master. I'm over my head in terms of most of the stuff regarding devops, so I've been primarily focused on the code changes to get that up to snuff.
CI4 added a lot of built in CRUD functions to the Model class, but we don't have to port our current CRUD methods to them at this point since what we have will work fine. So, I'm holding off on all that for now.
I think that if we squash all changes it will be easier to move changes from master into the branch, as it will only generate merge conflicts once we do the rebase. Also the history will be a lot cleaner as it will look like we started from latest master and we just amend everything that was added since the branch to the squashed commit.
So the advantage of this approach is that if git detects a moved file, and it sees that the original was changed in the meantime in master, it will try to apply those changes to the file in the new location. This seems to work for some of the files, but not for all of them currently (list below). I suppose for some reason it can't detect that it changed place. I'll check later on if there is a way to overcome this.
Auto-merging .gitignore
CONFLICT (content): Merge conflict in .gitignore
Auto-merging .travis.yml
CONFLICT (content): Merge conflict in .travis.yml
Auto-merging Dockerfile
CONFLICT (content): Merge conflict in Dockerfile
Auto-merging app/Helpers/locale_helper.php
Auto-merging app/Libraries/Token_lib.php
CONFLICT (content): Merge conflict in app/Libraries/Token_lib.php
Auto-merging app/Models/Reports/Summary_taxes.php
CONFLICT (content): Merge conflict in app/Models/Reports/Summary_taxes.php
Auto-merging app/Views/configs/info_config.php
CONFLICT (content): Merge conflict in app/Views/configs/info_config.php
Auto-merging app/Views/expenses/manage.php
Auto-merging app/Views/login.php
CONFLICT (content): Merge conflict in app/Views/login.php
Auto-merging app/Views/partial/header_js.php
Auto-merging app/Views/reports/tabular.php
Auto-merging app/Views/reports/tabular_details.php
CONFLICT (file location): application/views/sales/help.php added in HEAD inside a directory that was renamed in ca94e3ea8 (Composer Changes), suggesting it should perhaps be moved to app/Views/sales/help.php.
Auto-merging app/Views/sales/manage.php
CONFLICT (modify/delete): application/config/config.php deleted in ca94e3ea8 (Composer Changes) and modified in HEAD. Version HEAD of application/config/config.php left in tree.
CONFLICT (modify/delete): application/config/hooks.php deleted in ca94e3ea8 (Composer Changes) and modified in HEAD. Version HEAD of application/config/hooks.php left in tree.
CONFLICT (modify/delete): application/controllers/Items.php deleted in ca94e3ea8 (Composer Changes) and modified in HEAD. Version HEAD of application/controllers/Items.php left in tree.
CONFLICT (modify/delete): application/controllers/Login.php deleted in ca94e3ea8 (Composer Changes) and modified in HEAD. Version HEAD of application/controllers/Login.php left in tree.
CONFLICT (modify/delete): application/controllers/Messages.php deleted in ca94e3ea8 (Composer Changes) and modified in HEAD. Version HEAD of application/controllers/Messages.php left in tree.
CONFLICT (modify/delete): application/controllers/Reports.php deleted in ca94e3ea8 (Composer Changes) and modified in HEAD. Version HEAD of application/controllers/Reports.php left in tree.
CONFLICT (modify/delete): application/controllers/Sales.php deleted in ca94e3ea8 (Composer Changes) and modified in HEAD. Version HEAD of application/controllers/Sales.php left in tree.
CONFLICT (modify/delete): application/helpers/tabular_helper.php deleted in ca94e3ea8 (Composer Changes) and modified in HEAD. Version HEAD of application/helpers/tabular_helper.php left in tree.
CONFLICT (modify/delete): application/language/en-US/common_lang.php deleted in ca94e3ea8 (Composer Changes) and modified in HEAD. Version HEAD of application/language/en-US/common_lang.php left in tree.
CONFLICT (modify/delete): application/language/en-US/config_lang.php deleted in ca94e3ea8 (Composer Changes) and modified in HEAD. Version HEAD of application/language/en-US/config_lang.php left in tree.
CONFLICT (modify/delete): application/language/en-US/customers_lang.php deleted in ca94e3ea8 (Composer Changes) and modified in HEAD. Version HEAD of application/language/en-US/customers_lang.php left in tree.
CONFLICT (modify/delete): application/language/en-US/employees_lang.php deleted in ca94e3ea8 (Composer Changes) and modified in HEAD. Version HEAD of application/language/en-US/employees_lang.php left in tree.
CONFLICT (modify/delete): application/language/en-US/expenses_lang.php deleted in ca94e3ea8 (Composer Changes) and modified in HEAD. Version HEAD of application/language/en-US/expenses_lang.php left in tree.
CONFLICT (modify/delete): application/language/en-US/items_lang.php deleted in ca94e3ea8 (Composer Changes) and modified in HEAD. Version HEAD of application/language/en-US/items_lang.php left in tree.
CONFLICT (modify/delete): application/language/en-US/sales_lang.php deleted in ca94e3ea8 (Composer Changes) and modified in HEAD. Version HEAD of application/language/en-US/sales_lang.php left in tree.
CONFLICT (modify/delete): application/language/en-US/taxes_lang.php deleted in ca94e3ea8 (Composer Changes) and modified in HEAD. Version HEAD of application/language/en-US/taxes_lang.php left in tree.
CONFLICT (modify/delete): application/language/ta/cashups_lang.php deleted in ca94e3ea8 (Composer Changes) and modified in HEAD. Version HEAD of application/language/ta/cashups_lang.php left in tree.
CONFLICT (modify/delete): application/language/ta/item_kits_lang.php deleted in ca94e3ea8 (Composer Changes) and modified in HEAD. Version HEAD of application/language/ta/item_kits_lang.php left in tree.
CONFLICT (modify/delete): application/language/ta/module_lang.php deleted in ca94e3ea8 (Composer Changes) and modified in HEAD. Version HEAD of application/language/ta/module_lang.php left in tree.
CONFLICT (modify/delete): application/language/tl-PH/receivings_lang.php deleted in ca94e3ea8 (Composer Changes) and modified in HEAD. Version HEAD of application/language/tl-PH/receivings_lang.php left in tree.
CONFLICT (modify/delete): application/language/tl-PH/reports_lang.php deleted in ca94e3ea8 (Composer Changes) and modified in HEAD. Version HEAD of application/language/tl-PH/reports_lang.php left in tree.
CONFLICT (modify/delete): application/libraries/Sale_lib.php deleted in ca94e3ea8 (Composer Changes) and modified in HEAD. Version HEAD of application/libraries/Sale_lib.php left in tree.
CONFLICT (modify/delete): application/models/Appconfig.php deleted in ca94e3ea8 (Composer Changes) and modified in HEAD. Version HEAD of application/models/Appconfig.php left in tree.
CONFLICT (modify/delete): application/models/Employee.php deleted in ca94e3ea8 (Composer Changes) and modified in HEAD. Version HEAD of application/models/Employee.php left in tree.
CONFLICT (modify/delete): application/models/Sale.php deleted in ca94e3ea8 (Composer Changes) and modified in HEAD. Version HEAD of application/models/Sale.php left in tree.
CONFLICT (modify/delete): application/models/reports/Detailed_receivings.php deleted in ca94e3ea8 (Composer Changes) and modified in HEAD. Version HEAD of application/models/reports/Detailed_receivings.php left in tree.
CONFLICT (modify/delete): application/models/reports/Detailed_sales.php deleted in ca94e3ea8 (Composer Changes) and modified in HEAD. Version HEAD of application/models/reports/Detailed_sales.php left in tree.
CONFLICT (modify/delete): application/models/reports/Specific_customer.php deleted in ca94e3ea8 (Composer Changes) and modified in HEAD. Version HEAD of application/models/reports/Specific_customer.php left in tree.
CONFLICT (modify/delete): application/models/reports/Specific_discount.php deleted in ca94e3ea8 (Composer Changes) and modified in HEAD. Version HEAD of application/models/reports/Specific_discount.php left in tree.
CONFLICT (modify/delete): application/models/reports/Specific_employee.php deleted in ca94e3ea8 (Composer Changes) and modified in HEAD. Version HEAD of application/models/reports/Specific_employee.php left in tree.
CONFLICT (modify/delete): application/models/reports/Specific_supplier.php deleted in ca94e3ea8 (Composer Changes) and modified in HEAD. Version HEAD of application/models/reports/Specific_supplier.php left in tree.
CONFLICT (modify/delete): application/models/reports/Summary_items.php deleted in ca94e3ea8 (Composer Changes) and modified in HEAD. Version HEAD of application/models/reports/Summary_items.php left in tree.
CONFLICT (modify/delete): application/models/tokens/Token_invoice_sequence.php deleted in ca94e3ea8 (Composer Changes) and modified in HEAD. Version HEAD of application/models/tokens/Token_invoice_sequence.php left in tree.
CONFLICT (modify/delete): application/models/tokens/Token_quote_sequence.php deleted in ca94e3ea8 (Composer Changes) and modified in HEAD. Version HEAD of application/models/tokens/Token_quote_sequence.php left in tree.
CONFLICT (modify/delete): application/models/tokens/Token_work_order_sequence.php deleted in ca94e3ea8 (Composer Changes) and modified in HEAD. Version HEAD of application/models/tokens/Token_work_order_sequence.php left in tree.
CONFLICT (modify/delete): application/views/partial/footer.php deleted in ca94e3ea8 (Composer Changes) and modified in HEAD. Version HEAD of application/views/partial/footer.php left in tree.
CONFLICT (modify/delete): application/views/partial/header.php deleted in ca94e3ea8 (Composer Changes) and modified in HEAD. Version HEAD of application/views/partial/header.php left in tree.
CONFLICT (modify/delete): application/views/receivings/receiving.php deleted in ca94e3ea8 (Composer Changes) and modified in HEAD. Version HEAD of application/views/receivings/receiving.php left in tree.
CONFLICT (modify/delete): application/views/sales/form.php deleted in ca94e3ea8 (Composer Changes) and modified in HEAD. Version HEAD of application/views/sales/form.php left in tree.
CONFLICT (modify/delete): application/views/sales/register.php deleted in ca94e3ea8 (Composer Changes) and modified in HEAD. Version HEAD of application/views/sales/register.php left in tree.
Auto-merging composer.json
CONFLICT (content): Merge conflict in composer.json
Auto-merging composer.lock
CONFLICT (content): Merge conflict in composer.lock
Auto-merging package.json
CONFLICT (content): Merge conflict in package.json
CONFLICT (file location): application/hooks/method_hook.php added in HEAD inside a directory that was renamed in ca94e3ea8 (Composer Changes), suggesting it should perhaps be moved to writable/cache/method_hook.php.
error: could not apply ca94e3ea8... Composer Changes
Good work.
application is now app
hooks is now Events
subfolders of app now begin with a capital letter.
application/config/hooks.php is now app/Config/Events.php, though they are different files almost entirely.
There are two things I'm mildly concerned about.
1- In many cases, the changes made to the master, when brought over, will not work. This is usually because of differences between CI3 and CI4. For example, we may have a change that adds the line $this->input->get_post() but in CI4 this would be $this->request->getPost().
2- Where it does find the file and automatically port over the changes, will it be smart enough not to just give this giant amalgamation of the CI4 and CI3 files?
Ok cfr my question in the other thread on hook.php, you answered it here. It seems that git does not consider a files as moved once the content has changed too much. To avoid losing commit history I have now first moved those files in my local master manually to the new folder structure, and made a separate commit with only that.
Now I have reran the rebase on top of this new master. This time git does detect that the files were moved and generates a proper merge conflict. This makes merging the upstream changes a bit easier.
To make language file migration easier, I will just ignore the current merge conflicts. I will copy them again from the master branch and will try to use a tool, or build one myself, to convert them to the new format all at once.
@objecttothis I think I'm done with the version control work. I have pushed this in a new branch called ci4-upgrade. It has three commits on top of master
First commit contains the file moves to the new folder directory
Second commit has all your changes on top of it
Last commit applies the changes in master applied on top of the upgraded code
I have reverted all language files to the old structure for now. You converted one file already but it needs to be updated with changes from master. I copied all the files from master to the new folder structure and will rename and reformat them in one go in the weblate ticket, so basically will redo your work together with the other files.
I did not do any testrun yet so that might be a next thing. Do you have anything runtime tested already on your side, or an overview on what works and what does not?
So once we know this new branch is good then I think we can continue on that one instead and leave the old one behind?
I just started runtime testing and fixing bugs related to problems during runtime. Now I'm working on fixing the problems with hooks being converted to events and figuring out why the env file isn't properly overriding the config files.
As I'm looking through these commits, it appears to be only changes related to folders/files that have been moved which have not applied from the current master.
OK, I've checked the ones already applied and a few others that I ported over. We are down to 35 commits that need to be ported over to CI4 format. This is much more manageable.
I still have a set of stashed changes that contain some of the things that still need to be applied, apparantly. I also made a script to convert the language files to the new format, so I can do that in go. Then after I can try to import in weblate.
On the CSRF, I might need to read up, and I don't know if it can be solved by CI itself.
I think it's better to solve this on the output side of things, by properly escaping html entities and script tags before render. not on the input.
On the CSRF, I might need to read up, and I don't know if it can be solved by CI itself. I think it's better to solve this on the output side of things, by properly escaping html entities and script tags before render. not on the input.
OK, that's fine. If it ends up being needed then we can bring it over from the current master and port it to CI4. My only thought on the customization is that if there is a native solution that works as well, I think we should use the native solution since it makes it more resilient to upgrading the framework in the future.
I still have a set of stashed changes that contain some of the things that still need to be applied, apparantly. I also made a script to convert the language files to the new format, so I can do that in go. Then after I can try to import in weblate.
Super. The weblate in this branch is very far behind, so you may want to apply changes from weblate to it before running your conversion script and uploading.
OK, I've gotten it down to 5 commits that need to be ported over to CI4 format. I'll be on vacation until the 28th. Anyone can feel free to port them over, but make sure that the changes are using CI4-specific syntax and functions. I'll be back on the 28th.
@objecttothis I thought you were on vacation? I think we should rebase and squash again at some point. I think we can squash most commits except for the file move / renames. Otherwise let's continue testing and fixing stuff.
@objecttothis I thought you were on vacation? I think we should rebase and squash again at some point. I think we can squash most commits except for the file move / renames. Otherwise let's continue testing and fixing stuff.
I am... I was being naughty. Squash away. See you on the 28th. Feel free to work on the runtime issues. I added a couple of todo's where I thought we needed to fix something, but I think it will be obvious when you load the application.
I'm going to close this for now. If there are any other changes from the master that we need to merge in we can do so when it comes time to merge the PR into the master.
Activity
jekkos commentedon Nov 1, 2022
This won't be easy, but I can give it a try.. I might try to squash all commits in the branch first, it might make the sync easier
objecttothis commentedon Nov 1, 2022
If it were me, I would go back to each of the commits or branches that were merged into the master, look at what changes were made and then go make the corollary changes on #3271. If we try to merge Master onto CodeIgniter_4_upgrade then go through the conflicts one at a time, it's probably just going to say everything has changed so it's indistinguishable from what is CI4 related and what is changes that are made into the master.
I think this is a good argument for freezing direct merges to the master and asking changes to be a branch of CodeIgniter_4_upgrade so they get merged into that and we don't end up with a rats nest. The more people pitching in, the faster this upgrade will be done and out the door and we won't have the crazy. At minimum, my vote is to freeze merging new branches directly into the master. I'm over my head in terms of most of the stuff regarding devops, so I've been primarily focused on the code changes to get that up to snuff.
CI4 added a lot of built in CRUD functions to the Model class, but we don't have to port our current CRUD methods to them at this point since what we have will work fine. So, I'm holding off on all that for now.
jekkos commentedon Nov 1, 2022
I think that if we squash all changes it will be easier to move changes from master into the branch, as it will only generate merge conflicts once we do the rebase. Also the history will be a lot cleaner as it will look like we started from latest master and we just amend everything that was added since the branch to the squashed commit.
objecttothis commentedon Nov 1, 2022
That's fine with me.
jekkos commentedon Nov 1, 2022
So the advantage of this approach is that if git detects a moved file, and it sees that the original was changed in the meantime in master, it will try to apply those changes to the file in the new location. This seems to work for some of the files, but not for all of them currently (list below). I suppose for some reason it can't detect that it changed place. I'll check later on if there is a way to overcome this.
objecttothis commentedon Nov 1, 2022
Good work.
application is now app
hooks is now Events
subfolders of app now begin with a capital letter.
application/config/hooks.php is now app/Config/Events.php, though they are different files almost entirely.
There are two things I'm mildly concerned about.
1- In many cases, the changes made to the master, when brought over, will not work. This is usually because of differences between CI3 and CI4. For example, we may have a change that adds the line
$this->input->get_post()but in CI4 this would be$this->request->getPost().2- Where it does find the file and automatically port over the changes, will it be smart enough not to just give this giant amalgamation of the CI4 and CI3 files?
Good work. Thanks for helping with this.
jekkos commentedon Nov 6, 2022
Ok cfr my question in the other thread on hook.php, you answered it here. It seems that git does not consider a files as moved once the content has changed too much. To avoid losing commit history I have now first moved those files in my local master manually to the new folder structure, and made a separate commit with only that.
Now I have reran the rebase on top of this new master. This time git does detect that the files were moved and generates a proper merge conflict. This makes merging the upstream changes a bit easier.
jekkos commentedon Nov 6, 2022
To make language file migration easier, I will just ignore the current merge conflicts. I will copy them again from the master branch and will try to use a tool, or build one myself, to convert them to the new format all at once.
jekkos commentedon Nov 13, 2022
@objecttothis I think I'm done with the version control work. I have pushed this in a new branch called ci4-upgrade. It has three commits on top of master
I have reverted all language files to the old structure for now. You converted one file already but it needs to be updated with changes from master. I copied all the files from master to the new folder structure and will rename and reformat them in one go in the weblate ticket, so basically will redo your work together with the other files.
I did not do any testrun yet so that might be a next thing. Do you have anything runtime tested already on your side, or an overview on what works and what does not?
So once we know this new branch is good then I think we can continue on that one instead and leave the old one behind?
objecttothis commentedon Nov 13, 2022
I just started runtime testing and fixing bugs related to problems during runtime. Now I'm working on fixing the problems with hooks being converted to events and figuring out why the env file isn't properly overriding the config files.
10 remaining items
objecttothis commentedon Nov 17, 2022
As I'm looking through these commits, it appears to be only changes related to folders/files that have been moved which have not applied from the current master.
objecttothis commentedon Nov 17, 2022
OK, I've checked the ones already applied and a few others that I ported over. We are down to 35 commits that need to be ported over to CI4 format. This is much more manageable.
jekkos commentedon Nov 17, 2022
I still have a set of stashed changes that contain some of the things that still need to be applied, apparantly. I also made a script to convert the language files to the new format, so I can do that in go. Then after I can try to import in weblate.
jekkos commentedon Nov 17, 2022
On the CSRF, I might need to read up, and I don't know if it can be solved by CI itself.
I think it's better to solve this on the output side of things, by properly escaping html entities and script tags before render. not on the input.
[-]Merge changes from the Master into #3271[/-][+]CI4: Merge changes from the Master into #3271[/+]objecttothis commentedon Nov 18, 2022
OK, that's fine. If it ends up being needed then we can bring it over from the current master and port it to CI4. My only thought on the customization is that if there is a native solution that works as well, I think we should use the native solution since it makes it more resilient to upgrading the framework in the future.
objecttothis commentedon Nov 18, 2022
Super. The weblate in this branch is very far behind, so you may want to apply changes from weblate to it before running your conversion script and uploading.
jekkos commentedon Nov 18, 2022
I have moved the master versions of the translations to the new folder structure already, last thing to do is the format conversion
objecttothis commentedon Nov 18, 2022
OK, I've gotten it down to 5 commits that need to be ported over to CI4 format. I'll be on vacation until the 28th. Anyone can feel free to port them over, but make sure that the changes are using CI4-specific syntax and functions. I'll be back on the 28th.
objecttothis commentedon Nov 18, 2022
The newest commits are on top in the list above, so they should be ported over bottom to top.
jekkos commentedon Nov 20, 2022
@objecttothis I thought you were on vacation? I think we should rebase and squash again at some point. I think we can squash most commits except for the file move / renames. Otherwise let's continue testing and fixing stuff.
objecttothis commentedon Nov 20, 2022
I am... I was being naughty. Squash away. See you on the 28th. Feel free to work on the runtime issues. I added a couple of todo's where I thought we needed to fix something, but I think it will be obvious when you load the application.
objecttothis commentedon Feb 4, 2023
I'm going to close this for now. If there are any other changes from the master that we need to merge in we can do so when it comes time to merge the PR into the master.