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
DONE. CI4 does migrations a little different. In the login view in the past we checked to see if the latest version matched by calling <?php if (!$this->migration->is_latest()): ?>. The problem is that CI4 has no is_latest(). We need to get a function working and call it in the Login controller, then add the resulting bool to the view data that gets sent with echo view('login', $data). e.g., bool $is_latest.
CI4 validation is different from CI3, so we need to rework how we are validating username/password.
We need to have the migration->latest() kick off if needed upon successful login, then logout and redirect back to the login controller.
CSS is not working properly. This may be app-wide, but something isn't working properly.
With a clean database language lines aren't loading properly.
CI4 does migrations a little different. In the login view in the past we checked to see if the latest version matched by calling <?php if (!$this->migration->is_latest()): ?>. The problem is that CI4 has no is_latest(). We need to get a function working and call it in the Login controller, then add the resulting bool to the view data that gets sent with echo view('login', $data). e.g., bool $is_latest.
CI4 validation is different from CI3, so we need to rework how we are validating username/password.
Hi all, I've just stumbled upon OSPOS, and have to configure it for my dad's company, and I'll probably ("probably") need to maintain it/update it down the line... saw CI3 base, hopped onto GH, saw CI4 upgrade path so:
saw you already did MY_Migration, is_latest :) wanted to suggest aliasing it to your own class, but you got ahead of me
if I'm reading the docs clearly, you could possibly get around this with filters (as they allow you modifying the req/res objects), but that would basically mean ... writing a whole new routing mechanism for login/logout ... yeah, not such a good idea. :)
Thanks guys for doing this, tomorrow I'm setting up an OSPOS for the team, will be checking the progress (and contributing if I can) to any new and exciting developments :)
@mormy. Welcome! I'm glad to hear that OSPOS is of benefit to you. Most of us who contribute to the project are like you where we have a production install that we are maintaining and our contributions to the code are primarily to benefit our needs. You are welcome to make code contributions. The CI4 conversion is beastly, so anywhere you want to help is appreciated, but of course completely voluntary.
There is a gitter chat room. If you get stuck, post something there and hopefully someone can help you out. If you do want to make code contributions, let's try to coordinate. I have a fairly long list in the Pull Request of things that need to be done.
not surprised you're running into so much issues TBH, they did change A LOT in the CI 4.x branch ... all the find/replace stuff baked into modern IDEs won't help much.
at least I can do the translation to Croatian, as this is something I must do anyways. Will checkout gitter chat if I run into problems and-or have something relevant to contribute.
not surprised you're running into so much issues TBH, they did change A LOT in the CI 4.x branch ... all the find/replace stuff baked into modern IDEs won't help much.
at least I can do the translation to Croatian, as this is something I must do anyways. Will checkout gitter chat if I run into problems and-or have something relevant to contribute.
Thanks again :)
Yeah, I'm finding new stuff daily that isn't the same. Definite improvements, but they made zero effort at backward compatibility of the code.
@objecttothis in CI3 there was also a db table that contains the last migration ran. I also think there was a function to get all available migrations, so this function would be compare that string with the first or last migration in the list?
@objecttothis in CI3 there was also a db table that contains the last migration ran. I also think there was a function to get all available migrations, so this function would be compare that string with the first or last migration in the list?
Yes, and that table remains the same. It's easy enough to pull the value from that table. What CI4 doesn't have is a built-in function to tell you the latest version available in the code. They wrote it so that you would just call $migrate->latest(); and it would take care of the checking for you and run the migration. Our current method warns the person that when login happens, that the migration will run. It won't be difficult to write a short function to check the \app\Database\Migrations\ directory and parse out the latest version, then pop up the warning and on login call $migrate->latest();
I just pushed a fix so that it's properly checking the current version against the latest available and it now displays the warning message when there is a new version to migrate to. Yay insomnia!
@opensourcepos/org I just pushed a commit that fixes the validation in the login controller. It took me forever. Now we just need to configure it to kick off migrations on successful login.
Looks like the CI4 migrations table is much more complex (https://forum.codeigniter.com/showthread.php?tid=86564). We need to figure out how to migrate the ospos_migrations table to the CI4 structure in such a way that migrate->latest() will not try to re-run any previous migrations. This might be a little tricky because we may need to run any conversion script outside of the CI4 migrations functionality because migrations won't run without the table being the right structure. I suspect we will have to create another function in the MY_Migration class to detect when the migrations table is in CI3 format and run the sql to correct it. I have a few unanswered questions from my forum post, so I need to get those sorted out before I know how best to proceed. @mormy do you have any ideas about this?
The login is functionally working now, but CSS isn't being applied. I think that's more than just the login page though. We need to sort that out. Also migrations from an empty database are running properly, but the conversion from a CI3 version of OSPOS to CI4 version with migrations still needs to be worked on. That's outside the scope of this issue though. There's also an issue where on a clean database with no migrations table the language lines are not working.
Just a note to anyone that takes this. The language lines and CSS are broken on a 3.0.2 fresh database, but just the CSS is broken on a migrated or populated database. I suspect the language lines not working is a separate issue from the CSS problems
I haven't looked at the CI4 migration system in depth yet, but if we migrate old migrations to the table, they are automatically ran again? And there is no way to override this behavior, eg by flagging the migration as done or setting a version somewhere past their timestamps?
I haven't looked at the CI4 migration system in depth yet, but if we migrate old migrations to the table, they are automatically ran again? And there is no way to override this behavior, eg by flagging the migration as done or setting a version somewhere past their timestamps?
This is what I just fixed. For anyone on an OSPOS 3.0.2 to 3.3.8 version, OSPOS converts their migration table to CI4 format and adds rows in to that table manually so that no migrations get run again. Then it proceeds like it did before (check if it's the latest > migrate on login to latest).
Looks like the CI4 migrations table is much more complex (https://forum.codeigniter.com/showthread.php?tid=86564). We need to figure out how to migrate the ospos_migrations table to the CI4 structure in such a way that migrate->latest() will not try to re-run any previous migrations. This might be a little tricky because we may need to run any conversion script outside of the CI4 migrations functionality because migrations won't run without the table being the right structure. I suspect we will have to create another function in the MY_Migration class to detect when the migrations table is in CI3 format and run the sql to correct it. I have a few unanswered questions from my forum post, so I need to get those sorted out before I know how best to proceed. @mormy do you have any ideas about this?
sorry, no, not at the moment, .... docker compose doesn't work on windows 11 with WSL2 (CI3 base v3.3.8), there is a lot of broken stuff, dealing with that (also documentation is ... lacking, so fixing that first).
I would do a separate tool for migrating CI3 > CI4, and for now would flag CI4 support as for "new installs only", due to having a lot more stuff to do before tackling the migration problems ...
I think I see why the CSS isn't working properly. On my dev box the \public\bower_components folder has not been created and populated. @jekkos@SteveIreland or @odiea do any of you know how these properly get generated?
Yes, it's part of the build process. That was part of the fix I needed to make since it updates some of the PHP files with the minimized css file name. I'll try to submit the fix in the next day or two.
I added a commit that fixes the conventional (non-docker) build. There are some changes needed for the Docker scripts, but I don't yet have docker installed on my current box so I wouldn't be able to test them. I did not need to include --force on the grunt step.
In order to fix the language lines not loading properly I had to fix the default language code assigned in tables.sql. That was set to 'en' I changed it to 'en-US'. I think a long time ago 'en' is what we were using for the default language, but since we had to move to locales separating 'en-US' and 'en-GB' there no longer is an 'en' in \app\Language\
Activity
mormy commentedon Jan 30, 2023
Hi all, I've just stumbled upon OSPOS, and have to configure it for my dad's company, and I'll probably ("probably") need to maintain it/update it down the line... saw CI3 base, hopped onto GH, saw CI4 upgrade path so:
saw you already did MY_Migration, is_latest :) wanted to suggest aliasing it to your own class, but you got ahead of me
if I'm reading the docs clearly, you could possibly get around this with filters (as they allow you modifying the req/res objects), but that would basically mean ... writing a whole new routing mechanism for login/logout ... yeah, not such a good idea. :)
Thanks guys for doing this, tomorrow I'm setting up an OSPOS for the team, will be checking the progress (and contributing if I can) to any new and exciting developments :)
TY so very, very much for this software ...
objecttothis commentedon Jan 30, 2023
@mormy. Welcome! I'm glad to hear that OSPOS is of benefit to you. Most of us who contribute to the project are like you where we have a production install that we are maintaining and our contributions to the code are primarily to benefit our needs. You are welcome to make code contributions. The CI4 conversion is beastly, so anywhere you want to help is appreciated, but of course completely voluntary.
There is a gitter chat room. If you get stuck, post something there and hopefully someone can help you out. If you do want to make code contributions, let's try to coordinate. I have a fairly long list in the Pull Request of things that need to be done.
mormy commentedon Jan 30, 2023
not surprised you're running into so much issues TBH, they did change A LOT in the CI 4.x branch ... all the find/replace stuff baked into modern IDEs won't help much.
at least I can do the translation to Croatian, as this is something I must do anyways. Will checkout gitter chat if I run into problems and-or have something relevant to contribute.
Thanks again :)
objecttothis commentedon Jan 30, 2023
Yeah, I'm finding new stuff daily that isn't the same. Definite improvements, but they made zero effort at backward compatibility of the code.
We use weblate for translating the interface (https://translate.opensourcepos.org/about/) so maybe @jekkos can setup a Croatian translation if there isn't one already. The CI4 changeover will add a few phrases here and there, but nothing major.
objecttothis commentedon Jan 30, 2023
Looks like Croatian is already in weblate. Create an account and have at it. It's 62% at this point.

mormy commentedon Jan 30, 2023
yeah, I saw, will do :) (have to more like it :P)
jekkos commentedon Jan 30, 2023
@objecttothis in CI3 there was also a db table that contains the last migration ran. I also think there was a function to get all available migrations, so this function would be compare that string with the first or last migration in the list?
objecttothis commentedon Jan 30, 2023
Yes, and that table remains the same. It's easy enough to pull the value from that table. What CI4 doesn't have is a built-in function to tell you the latest version available in the code. They wrote it so that you would just call $migrate->latest(); and it would take care of the checking for you and run the migration. Our current method warns the person that when login happens, that the migration will run. It won't be difficult to write a short function to check the \app\Database\Migrations\ directory and parse out the latest version, then pop up the warning and on login call $migrate->latest();
objecttothis commentedon Jan 30, 2023
I just pushed a fix so that it's properly checking the current version against the latest available and it now displays the warning message when there is a new version to migrate to. Yay insomnia!
jekkos commentedon Jan 31, 2023
Great work @objecttothis
objecttothis commentedon Feb 2, 2023
@opensourcepos/org I just pushed a commit that fixes the validation in the login controller. It took me forever. Now we just need to configure it to kick off migrations on successful login.
objecttothis commentedon Feb 2, 2023
Looks like the CI4 migrations table is much more complex (https://forum.codeigniter.com/showthread.php?tid=86564). We need to figure out how to migrate the ospos_migrations table to the CI4 structure in such a way that migrate->latest() will not try to re-run any previous migrations. This might be a little tricky because we may need to run any conversion script outside of the CI4 migrations functionality because migrations won't run without the table being the right structure. I suspect we will have to create another function in the MY_Migration class to detect when the migrations table is in CI3 format and run the sql to correct it. I have a few unanswered questions from my forum post, so I need to get those sorted out before I know how best to proceed. @mormy do you have any ideas about this?
1 remaining item
objecttothis commentedon Feb 4, 2023
The login is functionally working now, but CSS isn't being applied. I think that's more than just the login page though. We need to sort that out. Also migrations from an empty database are running properly, but the conversion from a CI3 version of OSPOS to CI4 version with migrations still needs to be worked on. That's outside the scope of this issue though. There's also an issue where on a clean database with no migrations table the language lines are not working.
objecttothis commentedon Feb 5, 2023
Just a note to anyone that takes this. The language lines and CSS are broken on a 3.0.2 fresh database, but just the CSS is broken on a migrated or populated database. I suspect the language lines not working is a separate issue from the CSS problems
jekkos commentedon Feb 5, 2023
I haven't looked at the CI4 migration system in depth yet, but if we migrate old migrations to the table, they are automatically ran again? And there is no way to override this behavior, eg by flagging the migration as done or setting a version somewhere past their timestamps?
jekkos commentedon Feb 5, 2023
That would be a nice issue title, migrate the migrations.
objecttothis commentedon Feb 5, 2023
This is what I just fixed. For anyone on an OSPOS 3.0.2 to 3.3.8 version, OSPOS converts their migration table to CI4 format and adds rows in to that table manually so that no migrations get run again. Then it proceeds like it did before (check if it's the latest > migrate on login to latest).
objecttothis commentedon Feb 5, 2023
Yeah, that's almost what I named the issue #3647
mormy commentedon Feb 6, 2023
sorry, no, not at the moment, .... docker compose doesn't work on windows 11 with WSL2 (CI3 base v3.3.8), there is a lot of broken stuff, dealing with that (also documentation is ... lacking, so fixing that first).
I would do a separate tool for migrating CI3 > CI4, and for now would flag CI4 support as for "new installs only", due to having a lot more stuff to do before tackling the migration problems ...
objecttothis commentedon Feb 6, 2023
Thanks. Migrations is now sorted. We just need to have several people test it against copies of their production database to work out any kinks.
objecttothis commentedon Feb 6, 2023
I think I see why the CSS isn't working properly. On my dev box the \public\bower_components folder has not been created and populated. @jekkos @SteveIreland or @odiea do any of you know how these properly get generated?
SteveIreland commentedon Feb 6, 2023
Yes, it's part of the build process. That was part of the fix I needed to make since it updates some of the PHP files with the minimized css file name. I'll try to submit the fix in the next day or two.
jekkos commentedon Feb 6, 2023
@objecttothis these files are downloaded when you type
bower install. after that agruntshould create the minified versionsSteveIreland commentedon Feb 7, 2023
I added a commit that fixes the conventional (non-docker) build. There are some changes needed for the Docker scripts, but I don't yet have docker installed on my current box so I wouldn't be able to test them. I did not need to include --force on the grunt step.
objecttothis commentedon Feb 18, 2023
In order to fix the language lines not loading properly I had to fix the default language code assigned in tables.sql. That was set to 'en' I changed it to 'en-US'. I think a long time ago 'en' is what we were using for the default language, but since we had to move to locales separating 'en-US' and 'en-GB' there no longer is an 'en' in
\app\Language\