Skip to content

[document_repository] Add / Edit category failure #9956

@nicolasbrossard

Description

@nicolasbrossard

Describe the bug/issue
When trying to add a new category with a user who has the category edit permission, I get the following error:

Image Image

I was not able to get a PHP error from this.

When I try to edit a category name on the other hand, I get the following:

Image

[Mon Aug 04 15:01:06.858135 2025] [php:notice] [pid 36702] [client 192.168.122.1:49332] [CRITICAL] Invalid permission code document_repository_upload#0 /var/www/loris/php/libraries/UserPermissions.class.inc(110): UserPermissions->_permissionTrueAndValid()\n#1 /var/www/loris/php/libraries/UserPermissions.class.inc(167): UserPermissions->hasPermission()\n#2 /var/www/loris/modules/document_repository/php/editcategory.class.inc(43): UserPermissions->hasAnyPermission()\n#3 /var/www/loris/project/libraries/Module.class.inc(308): LORIS\document_repository\EditCategory->_hasAccess()\n#4 /var/www/loris/src/Middleware/ResponseGenerator.php(51): Module->handle()\n#5 /var/www/loris/src/Middleware/AuthMiddleware.php(64): LORIS\Middleware\ResponseGenerator->process()\n#6 /var/www/loris/src/Router/ModuleRouter.php(75): LORIS\Middleware\AuthMiddleware->process()\n#7 /var/www/loris/src/Middleware/ExceptionHandlingMiddleware.php(55): LORIS\Router\ModuleRouter->handle()\n#8 /var/www/loris/src/Router/BaseRouter.php(127): LORIS\Middleware\ExceptionHandlingMiddleware->process()\n#9 /var/www/loris/src/Middleware/ResponseGenerator.php(51): LORIS\Router\BaseRouter->handle()\n#10 /var/www/loris/src/Middleware/AWS.php(35): LORIS\Middleware\ResponseGenerator->process()\n#11 /var/www/loris/src/Middleware/ContentLength.php(53): LORIS\Middleware\AWS->process()\n#12 /var/www/loris/htdocs/index.php(115): LORIS\Middleware\ContentLength->process()\n#13 {main}, referer: https://ibis-rc.loris.ca/document_repository/?
[Mon Aug 04 15:01:06.858481 2025] [php:warn] [pid 36702] [client 192.168.122.1:49332] PHP Warning: Undefined array key "From" in /var/www/loris/src/Http/Error.php on line 74, referer: https://ibis-rc.loris.ca/document_repository/?

This also means step 12 of the test plan could not be tested

Please include:

  • Instrument/s (Specify instrument name and database name):
  • Questions/Fields involved (If requesting edits or addition of fields, please include field type and options for field):
  • Candidate/s affected (If applicable, list candidate with bug or issue to be resolved):
  • Visit/s:
  • Project/s (Sub-project/s if applicable):
  • Screenshot (If available):
  • URL of reported example/case:

To Reproduce
Steps to reproduce current behaviour (attach screenshots if applicable):

  1. Go to document repository with the permission to Edit/Upload/Delete Categories
  2. Try to upload a category
  3. See error
  4. Go to the "Edit category" page
  5. See error

Anticipated behaviour
To be able to add / edit categories.

Additional Information (If deemed useful)
Include additional information about the problem here.

Browser Environment (please complete the following information):

  • OS:
  • Browser: Chrome
  • Version:

Related tickets:

  • Issue Tracker (Original ticket if requested via Issue Tracker)
  • Github (Related Issues/PRs)
  • Redmine (Older tickets for additional context/background)

Please include appropriate labels and associated 'Projects' when creating the issue. Thanks!

Metadata

Metadata

Assignees

Labels

27.0.0 - BugsBugs Found in LORIS 27 testing

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions