Repository navigation
Description
Background information
- Reporting an issue of an unmodified OSPOS installation
- Checked open and closed issues and no similar issue was already reported (please make sure you searched!)
- Read README, WHATS_NEW, INSTALL.md and UPGRADE
- Read the FAQ for any known install and/or upgrade gotchas (in specific PHP extensions installed)
- Read the wiki
- Executed any database upgrade scripts if an upgrade pre 3.0.0 (e.g. database/2.4_to_3.0.sql)
- Aware the installation code is in bintray (see README), and GitHub master is for developers only and therefore not complete nor stable
Installation information
- OSPOS version is: 3.3.5
Issue / Bug / Question / New Feature
The Following code appears at the end of the Module model and I need to properly convert it to the CI4 equivalent. The problem is that the query doesn't make sense to me. This code was added about four years ago in code that @daN4cat and @SteveIreland worked on to add the office menu.
/**
* This method is used to show the office navigation icon on the home page
* which happens when the sort value is greater than zero
*/
public function get_show_office_group()
{
$this->db->select('sort');
$this->db->from('grants');
$this->db->where('module_id', 'office');
$this->db->from('modules');
return $this->db->get()->row()->sort;
}
The function seems to be returning the value of sort (int) from the modules table. Both the sort and module_id fields appear in the modules table. The question is: what is the intention with the $this->db->from('grants'); line? Was it meant to be a JOIN modules ON grants.menu_group = modules.module_id?
I may be mistaken, but I've never seen multiple from calls in the same QueryBuilder calls in the same way that you can do multiple where() or join(). Can anyone shed some light on this one for me?
Activity
daN4cat commentedon Nov 2, 2021
My mind is blank on this story I'm afraid.
jekkos commentedon Nov 16, 2021
Not sure how this query looks like, can you print a
this->db->last_query()after to see how it looks like?stale commentedon Dec 16, 2021
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
SteveIreland commentedon Dec 20, 2021
Looks like a copy and paste that went bad. I believe that the intent was to replace grants with modules. It wasn't caught in testing because apparently the generated SQL does enough that it passed the limited testing that was done on it.
objecttothis commentedon Dec 20, 2021
Thank you @SteveIreland. If I understand correctly, the code should look like this?
This makes sense because the grants table do not have a columns called sort or module_id. We should probably test that change outside of my change from CI3 to CI4. God knows that the CI3->CI4 change is going to need to be heavily regression tested.
SteveIreland commentedon Dec 20, 2021
That should work.
mrsarith commentedon Jan 20, 2022
Hello,
May you help me,please? I have one issue relate missing title on Modal form. I dont know I touch sth where else. That why, all title got blank.
here is my screenshot.
https://docs.google.com/document/d/1mSDYP13qqObWKmM7xpc55W_YmVk7Nn6T9-CJq0nO8pE/edit?usp=sharing
]
Sarith
daN4cat commentedon Jan 21, 2022
@mrsarith , is that from a modified OSPOS?
[-]Problem in Module model[/-][+]CI4: Problem in Module model[/+]objecttothis commentedon Apr 12, 2022
Fixed in #3271