Skip to content

PPP file upload/download fix - #1126

Merged
barryo merged 4 commits into
mainfrom
ppp-download
Oct 9, 2026
Merged

barryo merged 4 commits into
mainfrom
ppp-download

Conversation

@afk11

@afk11 afk11 commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

Per #1123, files can be uploaded to a patch panel port but not downloaded. This PR updates the file download to use the new file store. A migration step is required to migrate files from the old store to the new store.

Under the hood, it's using the system default filesystem, local in config/filesystems.php (files are stored in storage/app/files/ppp). I wonder, if we are to fix it, do we consider giving them their own 'filesystem' like we do docstore / docstore_customers? There's a migration step either way, so now seems a good time to consider it.

To migrate the old store to the new store, the following command should be run. The -a flag will preserve file permissions, ownership user/group, timestamps, context, and extended attributes.

cp -a $IXPROOT/storage/files/ppp/. $IXPROOT/storage/app/files/ppp/

Other work:

  • extract togglePrivacy on PatchPanelPortFile and PatchPanelPortHistoryFile, and use the boolean cast on is_private (see note below)
  • strict types on PPP\FileController and PPP\HistoryFileController (tested. fairly safe as there's no form stuff happening)
  • improve PPP file upload error handling - mostly to do with files that are too large.

Comment:
Added a cast to is_private as psalm complained about negating an int. This was invisible before using the update([]) syntax. On review, it seems we never directly print is_private, and it's only ever used as a logical boolean value (if statements and ternaries expressions). So the cast is appropriate and no reads required modification

Fixes #1123

afk11 added 4 commits October 8, 2026 14:44
Comment:
Added a cast to is_private as psalm complained about negating an int.
On review, it seems we never directly print is_private, and the only
contexts we use it in are as a boolean.
So the cast is appropriate (we only use it as a boolean anyway), and
no accessors required modification because they're all in if()'s
or used in ternary to print lock/unlock logos.
…would still hit the controller, and would trigger a 500 because isValid was not checked. also, in frontend, check response status, can detect uploads beyond post_max_size as they're rejected with 413 Content Too Large
@barryo
barryo merged commit d5d5d90 into main Oct 9, 2026
3 checks passed
@barryo
barryo deleted the ppp-download branch October 9, 2026 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PPP file upload broken

2 participants