Skip to content

Commit

Permalink
Merge pull request #392 from bugfolder/243_product_deletion
Browse files Browse the repository at this point in the history
Issue #243: Deleting class now allows deletion of content type.
  • Loading branch information
bugfolder authored Nov 21, 2022
2 parents f859868 + 53b63a7 commit 88c3eaf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion uc_product/uc_product.admin.inc
Original file line number Diff line number Diff line change
Expand Up @@ -501,14 +501,15 @@ function uc_product_class_delete_confirm($form, &$form_state, $class) {
function uc_product_class_delete_confirm_submit($form, &$form_state) {
$type = node_type_get_type($form_state['values']['pcid']);
$type->base = 'node_content';
$type->module = 'node';
$type->custom = 1;
node_type_save($type);

db_delete('uc_product_classes')
->condition('pcid', $form_state['values']['pcid'])
->execute();
module_invoke_all('uc_product_class', $form_state['values']['pcid'], 'delete');
// TODO migrate This nedded?
// TODO migrate This needed?
uc_product_node_info(TRUE);
node_types_rebuild();
menu_rebuild();
Expand Down
2 changes: 1 addition & 1 deletion uc_product/uc_product.module
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,7 @@ function uc_product_field_extra_fields() {
*/
function uc_product_field_delete_instance($instance) {
if ($instance['entity_type'] == 'node' && $instance['field_name'] == config_get('uc_product.settings', 'uc_image_' . $instance['bundle'])) {
config_clear('uc_product', 'uc_image_' . $instance['bundle']);
config_clear('uc_product.settings', 'uc_image_' . $instance['bundle']);
}
}

Expand Down

0 comments on commit 88c3eaf

Please sign in to comment.