Skip to content
This repository was archived by the owner on Aug 15, 2025. It is now read-only.
This repository was archived by the owner on Aug 15, 2025. It is now read-only.

Process API - Undefined array key "identifier" #88

Description

@madrzejewski

Hello,

On the process API, the following error can happen :

ErrorException:
Warning: Undefined array key "identifier"

at vendor/sandwave-io/realtimeregister-php/src/Domain/Process.php:150

This happens when we try to list all processes using :

$realtimeRegister->processes->list();

It seems that RTR can return processes without the identifier key. When this happens, it can throw an error.

I modified the ProcessApi.php file to debug this, and I found out that the processes without the identifier keys are the ones related to the action of adding credit to the account.

[ProcessesApi.php](file:///app/vendor/sandwave-io/realtimeregister-php/src/Api/ProcessesApi.php#L68) on line 68:
array:11 [▼
  "id" => REDACTED
  "user" => "rtr/admin"
  "customer" => "REDACTED"
  "status" => "COMPLETED"
  "createdDate" => "2024-04-17T13:58:17Z"
  "updatedDate" => "2024-04-17T13:58:17Z"
  "startedDate" => "2024-04-17T13:58:17Z"
  "action" => "allotmarketingcredit"
  "type" => "billing"
  "transaction" => array:1 [▼
    "EUR" => 1000000
  ]
  "command" => array:3 [▼
    "currency" => "EUR"
    "amount" => 1000000
    "description" => "test"
  ]
]

EDIT: There is some other actions that create a process without an identifier, for instance :

{
      "id": REDACTED,
      "user": "REDACTED",
      "customer": "REDACTED",
      "status": "COMPLETED",
      "createdDate": "2024-07-09T14:57:35Z",
      "updatedDate": "2024-07-09T14:57:35Z",
      "startedDate": "2024-07-09T14:57:35Z",
      "action": "createhmackey",
      "type": "customer",
      "command": {
          "customer": "REDACTED"
      }
  }

You can find those using the identifier + does not have a value filter.

Edit 2 : For now, I ignore/bypass the error using :

$realtimeRegister->processes->list(parameters: ['identifier:not_null' => ''])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions