Improve Plugin Error Handling (Bad file provisioner should throw more graceful error)

XMLWordPrintable

    • Type: Sub-task
    • Resolution: Unresolved
    • Priority: Minor
    • COmanage Registry 5.x.0
    • Affects Version/s: COmanage Registry 5.1.0 (Class 5 Rapids)
    • None

      When a CO has a File Provisioner established (FileConnector.FileProvisioners) that's got a bad configuration (e.g. no file path), attempting to save most models (a Person, a Group, a Group Member, etc) throws a file_put_contents() error. 

      Example stack trace when attempting to save a Group. Note that the Group does save, but the error results in an "An Internal Error Has Occurred" message in the view. It would be better to show a meaningful error message in the UI.

      2025-09-24 15:51:26 error: [TypeError] file_put_contents(): Argument #1 ($filename) must be of type string, null given in /registry/app/availableplugins/FileConnector/src/Model/Table/FileProvisionersTable.php on line 135
      Stack Trace:
      - ROOT/availableplugins/FileConnector/src/Model/Table/FileProvisionersTable.php:135
      - CORE/src/ORM/Association.php:1168
      - APP/Model/Table/ProvisioningTargetsTable.php:203
      - APP/Lib/Traits/ProvisionableTrait.php:64
      - APP/Controller/StandardController.php:442
      - CORE/src/Controller/Controller.php:505
      - CORE/src/Controller/ControllerFactory.php:166
      - CORE/src/Controller/ControllerFactory.php:141
      - CORE/src/Http/BaseApplication.php:362
      - CORE/src/Http/Runner.php:86
      - CORE/src/Http/Runner.php:86
      - CORE/src/Http/Middleware/CsrfProtectionMiddleware.php:169
      - CORE/src/Http/Runner.php:82
      - CORE/src/Http/Runner.php:60
      - CORE/src/Routing/Middleware/RoutingMiddleware.php:126
      - CORE/src/Http/Runner.php:82
      - CORE/src/Routing/Middleware/AssetMiddleware.php:70
      - CORE/src/Http/Runner.php:82
      - CORE/src/Error/Middleware/ErrorHandlerMiddleware.php:115
      - CORE/src/Http/Runner.php:82
      - ROOT/vendor/cakephp/debug_kit/src/Middleware/DebugKitMiddleware.php:60
      - CORE/src/Http/Runner.php:82
      - CORE/src/Http/Runner.php:60
      - CORE/src/Http/Server.php:104
      - ROOT/webroot/index.php:40
      - [main]:Request URL: /groups/edit/23
      Referer URL: https://locallinux.dogenmediadev.com/registry-pe/groups/edit/23
      Client IP: 10.211.55.2
       

            Assignee:
            Benn Oshrin
            Reporter:
            Arlen Johnson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: