News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

2.0.2, useless permission title

Started by Robert., May 05, 2012, 04:57:54 AM

Previous topic - Next topic

Robert.

G'day :) So I'm back again ;D When you disable the calendar or just don't enable it, the "select a permission" dropdown doesn't display the permissions of the calendar, but it does display "[Calendar]", which doesn't make sense when there are no permissions for it (as the calendar has been disabled). So far I've got no idea how to fix it, though. Using SMF 2.0.2, no mods installed :)

NanoSector

What "select a permission" dropdown are you talking about?
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Robert.

When you go to the manage permissions page, you see a list of groups and below that, you'll see some other things, like remove permissions and add permissions. I mean that one :)

NanoSector

Oh, that thing. Let me seek the code for it in a minute.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

emanuele

mmm...
ManagePermissions.php
Code (find) Select
ksort($context['permissions'][$permissionType]['columns']);
}

// Check we don't leave any empty groups - and mark hidden ones as such.
foreach ($context['permissions'][$permissionType]['columns'] as $column => $groups)
foreach ($groups as $id => $group)
{
if (empty($group['permissions']))
unset($context['permissions'][$permissionType]['columns'][$column][$id]);
else
{
$foundNonHidden = false;
foreach ($group['permissions'] as $permission)
if (empty($permission['hidden']))
$foundNonHidden = true;
if (!$foundNonHidden)
$context['permissions'][$permissionType]['columns'][$column][$id]['hidden'] = true;
}
}


Code (replace with) Select
ksort($context['permissions'][$permissionType]['columns']);

// Check we don't leave any empty groups - and mark hidden ones as such.
foreach ($context['permissions'][$permissionType]['columns'] as $column => $groups)
foreach ($groups as $id => $group)
{
if (empty($group['permissions']))
unset($context['permissions'][$permissionType]['columns'][$column][$id]);
else
{
$foundNonHidden = false;
foreach ($group['permissions'] as $permission)
if (empty($permission['hidden']))
$foundNonHidden = true;
if (!$foundNonHidden)
$context['permissions'][$permissionType]['columns'][$column][$id]['hidden'] = true;
}
}
}


* emanuele hopes this doesn't break anything else...

* emanuele waits a bit before apply it. ::)


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Robert.

Thanks for the patch. :) Applied and it works fine now :)

emanuele

commit b6fb1aeb92c9651e72a972ee452680604a67b026
Date:   Sun Jun 17 2012

    Removed unnecessary permissions from the select a permission dropdown - thank Dr. Deejay for the report


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

GL700Wing

I've noticed this is not in ManagePermissions.php in SMF 2.0.14 - it is implemented some other way/no longer necessary?
Life doesn't have to be perfect to be wonderful ...

Illori

as stated above the fix was committed. that is why this bug is in the fixed board.

Advertisement: