- 🇧🇪Belgium dieterholvoet Brussels
Drupal 7 is EOL as of 5 January 2025 and so is the Drupal 7 version of this module. Marking as Closed (won't fix). Feel free to re-open if this issue is still present in any supported version of the module.
No block-specific permissions are exported in Features, even when the relevant modules are checked under "Block Access" in the Features creation dialogue.
Looking at the Features export related code in the module, the reason is pretty clear: the block_access_get_module()
function only selects items from the block_access_roles
table with no delta
set:
/**
* get permissions for a given module
* @param $module - the name of the module
* @returns an array of Role IDs and their permissions
*/
function block_access_get_module($module) {
$query = db_select('block_access_roles', 'b')
->fields('b', array('rid', 'permission'))
->condition('module', $module, '=')
->condition('delta', '', '=');
$result = $query->execute();
$ret = array();
while ($ob = $result->fetchObject()) {
if (isset($ret[$ob->rid])) {
$ret[$ob->rid][] = $ob->permission;
}
else {
$ret[$ob->rid] = array($ob->permission);
}
}
return $ret;
}
This makes sense for module-specific permissions, but eliminates all block specific permissions (since the block delta is what makes a permission block-specific in the first place).
I followed some of the logic and played around a bit. The following steps got me a fair way along before I ran out of time to work on it:
array(
'block' => array(
'22' => array(
'4' => array(
'config_title',
),
'5' => array(
'config_title',
'config_body',
),
),
),
),
block_access_get_
so that it can extract info from the new structure.All of this achieved part one of the solution (i.e. correctly exporting the values), but I had to stop before getting to the parts around enabling and reverting Features.
Not sure if I'll be able to come back to this, but wanted to document the issue and first steps to a fix.
Closed: won't fix
1.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Drupal 7 is EOL as of 5 January 2025 and so is the Drupal 7 version of this module. Marking as Closed (won't fix). Feel free to re-open if this issue is still present in any supported version of the module.