Skip to content

PHP 8.4: Undefined array key "node" at NoteUtil.php#201 #1795

@danygrig

Description

@danygrig

Bug description

PHP 8.4 raises a warning:
Undefined array key "node" at NoteUtil.php#201

Steps to reproduce

  1. Install Nextcloud with PHP 8.4
  2. Install Notes app (latest version)
  3. Open Notes

Expected behavior

No warning, Notes works correctly.

Actual behavior

PHP Warning: Undefined array key "node" at
/apps/notes/lib/Service/NoteUtil.php#201

Line 201:
['path' => $defaultPath, 'node' => $folder] =
$this->settingsService->getDefaultNotesNode($userId);

Suggested fix

Replace line 201:

['path' => $defaultPath, 'node' => $folder] = $this->settingsService->getDefaultNotesNode($userId);

With:

$result = $this->settingsService->getDefaultNotesNode($userId);
$defaultPath = $result['path'] ?? null;
$folder = $result['node'] ?? null;
Copia e incolla questo blocco in fondo al corpo dell'issue, dopo la sezione Env

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneed to reproduceIssue that has not been reproduced

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions