Skip to content

Commit

Permalink
Bugfix #30: Renaming of categories or adding sourcing does not work w…
Browse files Browse the repository at this point in the history
…ith pretty URLs
  • Loading branch information
Jefferson49 committed Jul 30, 2023
1 parent 05604d6 commit 0015a9c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
5 changes: 3 additions & 2 deletions CallNumberDataFix.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ public function handle(ServerRequestInterface $request): ResponseInterface
{
$tree = Validator::attributes($request)->tree();
$repository_xref = Validator::attributes($request)->string(CallNumberCategory::VAR_XREF);
$category_name = Validator::attributes($request)->string(CallNumberCategory::VAR_CATEGORY_NAME);
$category_full_name = Validator::attributes($request)->string(CallNumberCategory::VAR_CATEGORY_FULL_NAME);

$category_name = Validator::queryParams($request)->string(CallNumberCategory::VAR_CATEGORY_NAME);
$category_full_name = Validator::queryParams($request)->string(CallNumberCategory::VAR_CATEGORY_FULL_NAME);

$data_fixes = $this->module_service->findByInterface(ModuleDataFixInterface::class);
$data_fix = RepositoryHierarchy::activeModuleName();
Expand Down
11 changes: 6 additions & 5 deletions CreateSourceModal.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,19 @@
class CreateSourceModal implements RequestHandlerInterface
{
/**
* Handle the create source model request
* Handle the create source modal request
*
* @param ServerRequestInterface $request
*
* @return ResponseInterface
*/
public function handle(ServerRequestInterface $request): ResponseInterface
{
$tree = Validator::attributes($request)->tree();
$user = Validator::attributes($request)->user();
$source_repository = Validator::attributes($request)->string('xref');
$source_call_number = Validator::attributes($request)->string('source_call_number');
$tree = Validator::attributes($request)->tree();
$user = Validator::attributes($request)->user();
$source_repository = Validator::attributes($request)->string('xref');

$source_call_number = Validator::queryParams($request)->string('source_call_number');

//If no user is logged in, show error text
if (Auth::accessLevel($tree, $user) === Auth::PRIV_PRIVATE) {
Expand Down
9 changes: 3 additions & 6 deletions RepositoryHierarchy.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,7 @@ public function boot(): void
CreateSourceModal::class,
'/tree/'.self::TREE_ATTRIBUTE_DEFAULT.
'/'.self::CREATE_SOURCE_IN_ROUTE.
'/xref/'.self::XREF_ATTRIBUTE_DEFAULT.
'/source_call_number/'.self::SOURCE_CALL_NUMBER_ATTRIBUTE_DEFAULT
'/xref/'.self::XREF_ATTRIBUTE_DEFAULT
)
->allows(RequestMethodInterface::METHOD_POST);

Expand All @@ -311,9 +310,7 @@ public function boot(): void
CallNumberDataFix::class,
'/tree/'.self::TREE_ATTRIBUTE_DEFAULT.
'/'.self::FIX_CALL_NUMBER_IN_ROUTE.
'/xref/'.self::XREF_ATTRIBUTE_DEFAULT.
'/category_name/'.self::CATEGORY_NAME_ATTRIBUTE_DEFAULT.
'/category_full_name/'.self::CATEGORY_FULL_NAME_ATTRIBUTE_DEFAULT
'/xref/'.self::XREF_ATTRIBUTE_DEFAULT
)
->allows(RequestMethodInterface::METHOD_POST);

Expand All @@ -327,7 +324,7 @@ public function boot(): void
)
->allows(RequestMethodInterface::METHOD_POST);

//Register a route for the XML export settings ation
//Register a route for the XML export settings action
$router ->get(
XmlExportSettingsAction::class,
'/tree/'.self::TREE_ATTRIBUTE_DEFAULT.
Expand Down

0 comments on commit 0015a9c

Please sign in to comment.