Skip to content

Commit

Permalink
Merge pull request #14 from uasoft-indonesia/develop
Browse files Browse the repository at this point in the history
- bug fix menu permission not generated in data type seeder
  • Loading branch information
sulfanoaf authored Mar 30, 2021
2 parents c71861a + 527ce73 commit 2ddd478
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/ContentManager/ContentGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class ContentGenerator
'icon_class' => '%s',
'color' => null,
'parent_id' => null,
'permissions' => '%s',
'order' => $order,
])->save();
} else {
Expand All @@ -48,6 +49,7 @@ class ContentGenerator
$menu_item->icon_class = '%s';
$menu_item->color = null;
$menu_item->parent_id = null;
$menu_item->permissions = '%s';
$menu_item->order = $order;
$menu_item->save();
}
Expand Down Expand Up @@ -185,9 +187,11 @@ public function getMenuInsertStatements($data_type): string
$url,
$data_type->display_name_plural,
$data_type->icon,
$data_type->generate_permissions ? 'browse_'.$data_type->name : null,
$url,
$data_type->display_name_plural,
$data_type->icon
$data_type->icon,
$data_type->generate_permissions ? 'browse_'.$data_type->name : null
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/ContentManager/FileGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function generateDataTypeSeedFile(DataType $data_type): bool

$seeder_file = $this->file_system->getSeederFile($seeder_class_name, $seed_folder_path);

$data_type->details = json_encode($data_type->details);
$data_type->details = (!is_null($data_type->details)) ? json_encode($data_type->details) : null;

$stub = $this->content_manager->replaceString('{{class}}', $seeder_class_name, $stub);

Expand Down

0 comments on commit 2ddd478

Please sign in to comment.