• 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
Screenshots Loading commit data...
app Loading commit data...
bootstrap Loading commit data...
config Loading commit data...
database Loading commit data...
docker Loading commit data...
docs Loading commit data...
docs-site Loading commit data...
flutter_shell Loading commit data...
gap-filling-plans Loading commit data...
lang Loading commit data...
marketing-site Loading commit data...
plans Loading commit data...
public Loading commit data...
reference/oc-sport Loading commit data...
resources Loading commit data...
routes Loading commit data...
scripts Loading commit data...
storage Loading commit data...
tests Loading commit data...
.dockerignore Loading commit data...
.editorconfig Loading commit data...
.env.example Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.npmrc Loading commit data...
Beanding Guide.txt Loading commit data...
CLAUDE.md Loading commit data...
Dockerfile Loading commit data...
README.md Loading commit data...
artisan Loading commit data...
captain-definition Loading commit data...
composer.json Loading commit data...
composer.lock Loading commit data...
deploy.sh Loading commit data...
elcaptain-sportsonly-db.md Loading commit data...
one-click-app.yml Loading commit data...
package-lock.json Loading commit data...
package.json Loading commit data...
phpunit.xml Loading commit data...
system info.txt Loading commit data...
vite.config.js Loading commit data...
نادى الشيخ زايد كشف بيانات اللاعبين (2).html Loading commit data...