- π·π΄Romania claudiu.cristea Arad π·π΄
This version of Drupal is not supported anymore. If this is still an issue in the
8.x-1.x
branch, please open a new up-to-date ticket. Closing.
I have a custom module, and in:
mymodule_node_type($op, $info)
I use:
og_get_types('group_post')
, to retrieve the node types used as standard group post.
Now, I have content type: type_a, and type_b, which are set to be standard group post.
However, if I step into: admin/content/node-type/type_a, and click "save content type" without any modification, the function : og_get_types('group_post')
in mymodule_node_type($op, $info)
only returns type_b.
The reason lies in:
function og_node_type($op, $info) {
switch ($op) {
case 'delete':
variable_del('og_content_type_usage_'. $info->type);
variable_del('og_max_groups_'. $info->type);
break;
case 'update':
if (isset($info->old_type)) {
variable_del('og_content_type_usage_'. $info->old_type);
}
}
}
No matter I modify type_a or not, when I click "save content type", $info will always have $info->old_type = type_a, so the usage will be deleted by :
if (isset($info->old_type)) {
variable_del('og_content_type_usage_'. $info->old_type);
}
Thus, in my hook_node_type, even though the group usage for type_a has not been changed, og_get_types('group_post')
will not be able to retrieve type_a.
Will this be considered as a bug of og module? Is there a better replacement for the following:
if (isset($info->old_type)) {
variable_del('og_content_type_usage_'. $info->old_type);
}
Thanks.
Closed: outdated
2.1
og.module
This version of Drupal is not supported anymore. If this is still an issue in the 8.x-1.x
branch, please open a new up-to-date ticket. Closing.