• Mahmoud Aglan's avatar
    fix(expenses): read the upload's metadata before store() moves it away · 7622238b
    Mahmoud Aglan authored
    This is the actual reason no receipt could be attached — 1b62a44f-… and
    every other support code from the expense pages:
    
        UnableToRetrieveMetadata: Unable to retrieve the file_size for file
        at location: livewire-tmp/adbO73…jpg
        ExpenseShow.php(93): TemporaryUploadedFile->getSize()
    
    store() moves the file out of livewire-tmp. The attachment array put
    'path' => $file->store(…) on its first line, and PHP evaluates array
    literals in order, so getMimeType() and getSize() on the lines below ran
    against a path that had just stopped existing. Validation passed, the
    vanished-upload guard passed, the file was even written to its final
    home — and then the request died with a 500 on the way to the row.
    Nothing was ever saved.
    
    Both handlers now read name, mime and size into locals first and store
    last. Reproduced against a real local disk before and after; Livewire's
    test harness swaps in a temp disk that does not move the file, which is
    why a component test would have gone green on the broken code, so the
    regression guard asserts the source ordering instead.
    Co-Authored-By: 's avatarClaude Opus 5 (1M context) <noreply@anthropic.com>
    7622238b
Name
Last commit
Last update
..
Activities Loading commit data...
Admin Loading commit data...
Assignments Loading commit data...
Attendance Loading commit data...
Audit Loading commit data...
Auth Loading commit data...
Branches Loading commit data...
CashSessions Loading commit data...
Components Loading commit data...
Concerns Loading commit data...
Dashboard Loading commit data...
Documents Loading commit data...
Enrollments Loading commit data...
Evaluations Loading commit data...
Events Loading commit data...
Facilities Loading commit data...
Financial Loading commit data...
Groups Loading commit data...
Guardian Loading commit data...
HR Loading commit data...
Inventory Loading commit data...
Invoices Loading commit data...
Messaging Loading commit data...
Notifications Loading commit data...
POS Loading commit data...
Parent Loading commit data...
Participants Loading commit data...
People Loading commit data...
Portal Loading commit data...
Pricing Loading commit data...
Profile Loading commit data...
Programs Loading commit data...
Public Loading commit data...
Receptionist Loading commit data...
Reports Loading commit data...
Requests Loading commit data...
Roles Loading commit data...
Schedule Loading commit data...
Settings Loading commit data...
Trainer Loading commit data...
Training Loading commit data...
Users Loading commit data...
Wallets Loading commit data...
Website Loading commit data...
WhatsApp Loading commit data...
Wizards Loading commit data...
BranchSwitcher.php Loading commit data...
Dashboard.php Loading commit data...
GlobalSearch.php Loading commit data...