Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v6 compat update #5

Merged
merged 6 commits into from
Feb 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions system/user/addons/wiki/addon.setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

return array(
'author' => 'EllisLab',
'author_url' => 'http://ellislab.com/',
'author_url' => 'https://expressionengine.com/',
'name' => 'Wiki',
'description' => '',
'version' => '4.0.0',
'version' => '5.0.0',
'namespace' => 'User\Addons\Wiki',
'settings_exist' => TRUE,
'docs_url' => 'https://github.com/EllisLab/Wiki/wiki',
Expand Down
8 changes: 4 additions & 4 deletions system/user/addons/wiki/language/english/wiki_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@

'namespace_admins' => 'Admins',

'namespace_admins_desc' => 'Member groups to administrate this namespace.<br>
'namespace_admins_desc' => 'Member roles to administrate this namespace.<br>
Super Administrators are automatically administrators.',

'namespace_users_desc' => 'Member groups that can access this namespace',
'namespace_users_desc' => 'Member roles that can access this namespace',

'users_description' => 'Member groups that can access this wiki.',
'users_description' => 'Member roles that can access this wiki.',

'admins_description' => 'Member groups to administrate this wiki.<br>
Super Administrators are automatically administrators.',
Expand Down Expand Up @@ -128,7 +128,7 @@

'basepath_unset' => 'Base Path Parameter Not Set',

'users' => 'Groups',
'users' => 'Roles',

'admins' => 'Administrators',

Expand Down
17 changes: 10 additions & 7 deletions system/user/addons/wiki/mcp.wiki.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,14 @@ function delete()

function get_member_groups()
{
$this->member_groups = ee('Model')->get('MemberGroup')
->filter('group_id', 'NOT IN', array(1,2,3,4))
->filter('site_id', ee()->config->item('site_id'))
->order('group_title')
->all();
// update for v6 return primary member roles

$this->member_groups = ee('Model')->get('Role')
->filter('role_id', 'NOT IN', array('2', '3', '4'))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is role 1 removed here intentionally?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It really should exclude superadmin (this is for populating the selects)- but see #6

So I left superadmin in there- they probably shouldn't be and if you don't select them it's moot. But this way, you can still unselect all of the non-super.

I left it for now, but when that's fixed, they should be dropped. Not elegant, but functional, and I wasn't going to redo that display right now.

->order('name')
->all();


}

// -------------------------------------------------------------------------
Expand Down Expand Up @@ -464,7 +467,7 @@ function make_form($wiki_id, $wiki = NULL)
$member_group_options = array();
foreach ($this->member_groups as $group)
{
$member_group_options[$group->group_id] = $group->group_title;
$member_group_options[$group->role_id] = $group->name;
}


Expand Down Expand Up @@ -683,7 +686,7 @@ private function getNamespaceGrid($wiki_id = NULL)

foreach ($this->member_groups as $group)
{
$member_choices[$group->group_id] = $group->group_title;
$member_choices[$group->role_id] = $group->name;
}

$grid->setBlankRow($this->getGridRow($member_choices));
Expand Down
Loading