Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
drupal.org
better_formats
Commits
6a24dfa8
Commit
6a24dfa8
authored
May 17, 2009
by
dragonwize
Browse files
Fixed error on install when both core roles have zero permissions set.
parent
00ada777
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
10 deletions
+13
-10
better_formats.install
better_formats.install
+13
-10
No files found.
better_formats.install
View file @
6a24dfa8
...
...
@@ -85,18 +85,21 @@ function better_formats_install() {
$result
=
db_query
(
$sql
);
$row_perms
=
array
();
while
(
$row
=
db_fetch_object
(
$result
))
{
$role_perms
[]
=
$row
;
$role_perms
[
$row
->
rid
]
=
$row
;
}
// Add perms to core roles (anonymous user, authenticated user).
foreach
(
$role_perms
as
$perms
)
{
$sql
=
"UPDATE
{
permission
}
SET perm = '%s'
WHERE pid = %d"
;
db_query
(
$sql
,
$perms
->
perm
.
$default_perms
,
$perms
->
pid
);
// If a role has no permissions set it will not have a row in the database.
// Assume that roles do not need perms set for BF as well if none are set.
if
(
!
empty
(
$role_perms
))
{
// Add perms to core roles (anonymous user, authenticated user).
foreach
(
$role_perms
as
$perms
)
{
$sql
=
"UPDATE
{
permission
}
SET perm = '%s'
WHERE pid = %d"
;
db_query
(
$sql
,
$perms
->
perm
.
$default_perms
,
$perms
->
pid
);
}
// Clear the cached pages
cache_clear_all
();
}
// Clear the cached pages
cache_clear_all
();
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment