Utility/structure needed? once upgrade to 2.2.1 done
Recently upgraded from 2.2.5 (found @ GitHub's master branch 2014 Jan.) to this 2.2.1
It seems right but... now ;-) I should run utility/structure isn't ?
Not seen at your doc' upgrading instructions but previously (2.0 and 2.1 may be) it was "required" then do you know if I must do it now...
Many thanks in advance
Best Answer
-
R_J Admin
Thanks for posting that short list! I had no luck to reproduce that message and so I've reinstalled a test version, now being able to see this message! Here's the explanation...
Users permissions are cached so that they do not have to be calculated again and again. If you do not use a cache like memcached, the permissions are cached in the User table, column Permissions.
In order to run utility/structure, the permissions of the current user are checked. If they are not calculated yet, they will be calculated and cached in User.Permissions.
This means that in order to clean that column, it couldn't be empty. See where this will end? Infinity!Since my normal test installation uses memcached, I couldn't reproduce this at first.
Well, the conclusion of all this is that you can safely ignore this remaining result of /utility/structure. It will never disappear. I'll file this as an issue on GitHub, but I'm not 100% sure that there will be a solution for this.
3
Answers
Yes it is you should do it. It can't hurt. You can run it several times even.
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
Ok, thanks @vrijvlinder and then ;-) tried it
Fisrt time
`update GDN_Role 'Role'
set Type = 'applicant'
where RoleID = '4';
update GDN_Role 'Role'
set Type = 'member'
where RoleID = '8';
update GDN_Role 'Role'
set Type = 'unconfirmed'
where RoleID = '3';
update GDN_Role 'Role'
set Type = 'guest'
where RoleID = '2';
delete from GDN_UserRole
where UserID = '0';
update GDN_User 'User'
set Permissions = ''
where Permissions <> '';
alter table 'GDN_Tag'
/* Existing: 'FullName' varchar(255) not null, New: 'FullName' varchar(100) not null */
change 'FullName' 'FullName' varchar(100) not null;`
Done and 'Rescan' once
`update GDN_Role 'Role'
set Type = 'applicant'
where RoleID = '4';
update GDN_Role 'Role'
set Type = 'member'
where RoleID = '8';
update GDN_Role 'Role'
set Type = 'unconfirmed'
where RoleID = '3';
update GDN_User 'User'
set Permissions = ''
where Permissions <> '';`
So 'Rescan' and 'Rescan' and above is still displayed!
Do you know if I could do something in order to fix it? thank to you
Using PHP 5.5 and MySQL 5.6 / Apache 2.4
You can go into the mysql data base and change those values manually .
Important Default roles are
admin 1
System 2
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
Yep, thanks to you @vrijvlinder for your support
But it seems done, already ;-) in fact (phpMyAdmin screenshot, below)
Voila... is it right ?
No, As I said before … admin is role 1 and System is 2 … Guest can't be 2
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
And even running the sql manually on the database doesn't change anything on the message from utility structure. I guess there is a bug somewhere. I'll try to hunt it down...
You should fix admin and moderator role and try
SELECT count(*) FROM GDN_User WHERE Permissions = ''
on the database. If it is not 0, you should runmanually.
You can safely ignore:
You have no chance to make that disappear. I've a pull request on GitHub and so I assume it will be fixed in the next Vanilla version.
Ok @vrijvlinder, but tried a fresh install then Guest role is 2 and no System role, here!
Really not an expert ;-) but Admin role seems to be 16 not 1, isn't ?
I guess vrijvlinder mixed this up with a column in the user table. Your roles are correct.
Exact... done via phpMyAdmin, thanks you @R_J
Noticed than Unconfirmed role still deletable (1, it should be 0 ?) but ;-) not important (at this time)
Well, as said above, manually ;-) added these moderator and administrator types in 'GDN_UserRole' table, 'Type' column
Later tried your query, result is 9, so not 0
In fact there 're 11 members
a:34:{i:0;s:17:"Garden.Email.View";i:1
etcbut all others 're empty (11-2=9)
Noticed than once a user/member is logged in then something is added to this 'Permissions' column
but not all members 'll be back...
If it is a clean install, I would have thought that unconfirmed has deletable = 0
https://github.com/vanilla/vanilla/blob/master/applications/dashboard/settings/structure.php#L51
$RoleModel->define(array('Name' => 'Unconfirmed', 'Type' => RoleModel::TYPE_UNCONFIRMED, 'RoleID' => 3, 'Sort' => $Sort++, 'Deletable' => '0', 'CanSession' => '1', 'Description' => t('Unconfirmed Role Description', 'Users must confirm their emails before becoming full members. They get assigned to this role.')));
But that is not checked in /utility/structure so it is no wonder that it is not changed
Yep, @vrijvlinder check out GDN_User, in this 'Admin' table, my first admin is 1 and my system is 2 (other members is 0)
Did you mind @R_J the following query?
They are identical.
In SQL you can give alias names to tables. This is very comfortable if you have a query that joins multiple tables. If you are working with only one table, an alias is not needed.
The one thing I hate about SQL is the use of apostrophes and so I simply left that part out.
I tried to run the commands above, but i still shows me 13 counts. Am I understanding it right that all my members should have a "null" in the permissions table?
I still get
update GDN_User
User
set Permissions = ''
where Permissions <> '';
I've made a mistake:
SELECT count(*) FROM GDN_User WHERE Permissions <> ''
. Since all users where Permissions are not empty (empty, not NULL) should be changed, you should only count them.But what appears when you run /utility/structure? Please don't get confused just because of my hackish SQLs. The output of the official SQLs are much more important.
'update GDN_Role
Role
set Type = 'applicant'
where RoleID = '4';
update GDN_Role
Role
set Type = 'member'
where RoleID = '8';
update GDN_Role
Role
set Type = 'unconfirmed'
where RoleID = '3';
update GDN_User
User
set Permissions = ''
where Permissions <> '';'
I get this Output. All Users (beside my logged in admin) have empty permissions.
When i run your script it counts "1".
Please post a list of all activated addons and plugins (from your config.php the sections
// EnabledApplications
and// EnabledPlugins
I do not even get that message if I write values in that column and so this message is coming from a plugin/addon you are using.
Well, thanks @R_J then I 'll try it